ServiceClass:
public void createManualEvaluationReductionChangeHistory(Long key, String accountId, RegisterReductionPerFunction registerReductionPerFunction, String languageCode, String comments, String pagRedFlag) {
ProfessionalCustomerHistory professionalCustomerHistory = new ProfessionalCustomerHistory();
professionalCustomerHistory.setDescription(comments);
professionalCustomerHistory.setReductionCategory(registerReductionPerFunction.getReductionCategoryCode());
professionalCustomerHistory.setReductionType(registerReductionPerFunction.getReductionTypeCode());
professionalCustomerHistory.setValidityId(registerReductionPerFunction.getValidityId().longValue());
professionalCustomerHistory.setReductionPercentage(reductionCategoryService.getReductionPercentage(languageCode,
registerReductionPerFunction.getReductionCategoryCode(), registerReductionPerFunction.getReductionTypeCode()));
professionalCustomerHistory.setTotalReduction(professionalCustomerHistory.getReductionPercentage());
professionalCustomerHistory.setPagFixedReductionFlag(pagRedFlag);
setCommonHistoryDetails(professionalCustomerHistory, Constants.NO, accountId, key, Constants.HISTORY_TYPE_REDUCTIONS);
professionalCustomerHistoryDlService.create(professionalCustomerHistory);
}
Тест Junit: @ Test
public void createManualEvaluationReductionChangeHistory() {
ProfessionalCustomerHistory professionalCustomerHistory = new ProfessionalCustomerHistory();
RegisterReductionPerFunction registerReductionPerFunction = new RegisterReductionPerFunction();
professionalCustomerHistory.setValidityId(1L);
registerReductionPerFunction.setValidityId(1);
professionalCustomerHistory.setProfCustomerId(PROF_CUST_ID);
professionalCustomerHistory.setHistoryType("RD");
professionalCustomerHistory.setEditedBy(ACCOUNT_ID);
professionalCustomerHistory.setHistoryDate(new Date());
professionalCustomerHistory.setNoDeleteFlag("N");
professionalCustomerHistory.setReductionPercentage(null);
professionalCustomerHistory.setTotalReduction(null);
professionalCustomerHistory.setDescription(COMMENTS);
Mockito.when(reductionCategoryService.getReductionPercentage(LANGUAGE_CODE, null, null)).thenReturn(null);
profCustomerHistoryService.createManualEvaluationReductionChangeHistory(PROF_CUST_ID, ACCOUNT_ID.toString(), registerReductionPerFunction, LANGUAGE_CODE, COMMENTS, null);
Mockito.verify(reductionCategoryService).getReductionPercentage(LANGUAGE_CODE,null,null);
Mockito.verify(professionalCustomerHistoryDlService).create(professionalCustomerHistory);
}
Когда я тестирую его, получаю ошибку ниже.
Аргумент (ы) разные! Требуется: фактический вызов имеет разные аргументы:
Но я вижу, что все параметры одинаковы. что может быть причиной проблемы?