【发布时间】:2022-01-20 08:58:26
【问题描述】:
我有一门课要测试,但我不知道如何测试它。有人可以帮忙测试吗?
@Component
public class KvkkCorrBankingExecuter {
private final Map<String, IKvkkCorrBankingExecuter> operationMap = new HashMap<>();
IKvkkCorrBankingExecuter executer;
@Autowired
DemandBoeExecuter demandBoeExecuter;
@Autowired
DemandCleanBaExecuter demandCleanBaExecuter;
@Autowired
DemandGuaranteeExecuter demandGuaranteeExecuter;
@Autowired
DemandLcExecuter demandLcExecuter;
@Autowired
DemandSlcExecuter demandSlcExecuter;
@PostConstruct
public void init() {
operationMap.put("DEMAND_BOE", demandBoeExecuter);
operationMap.put("DEMAND_CLEAN_BA", demandCleanBaExecuter);
operationMap.put("DEMAND_GUARANTEE", demandGuaranteeExecuter);
operationMap.put("DEMAND_LC", demandLcExecuter);
operationMap.put("DEMAND_SLC", demandSlcExecuter);
}
}
映射线和初始化函数在协变中以红色突出显示。它们需要进行测试。
【问题讨论】:
标签: java testing junit hashmap mockito