Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public CreditorInstitutionDetails fromDto(UpdateCreditorInstitutionDto dto) {
creditorInstitutionDetails.setCreditorInstitutionCode(dto.getCreditorInstitutionCode());
creditorInstitutionDetails.setEnabled(dto.getEnabled());
creditorInstitutionDetails.setBusinessName(dto.getBusinessName());
creditorInstitutionDetails.setCbillCode(dto.getCbillCode());
creditorInstitutionDetails.setAddress(fromDto(dto.getAddress()));
creditorInstitutionDetails.setPspPayment(dto.getPspPayment());
creditorInstitutionDetails.setReportingFtp(dto.getReportingFtp());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,20 @@ void updateCreditorInstitution_ok() throws IOException {
assertNotNull(result);
}

@Test
void updateCreditorInstitution_shouldPreserveCbillCode() throws IOException {
when(apiConfigClient.updateCreditorInstitutionDetails(anyString(), any(CreditorInstitutionDetails.class)))
.thenAnswer(invocation -> invocation.getArgument(1));

UpdateCreditorInstitutionDto dto = TestUtil.fileToObject("request/post_creditor_institution.json", UpdateCreditorInstitutionDto.class);
assertEquals("COXYZ", dto.getCbillCode(), "Test fixture should have cbillCode");

CreditorInstitutionDetailsResource result = service.updateCreditorInstitutionDetails(CI_TAX_CODE, dto);

assertNotNull(result);
assertEquals("COXYZ", result.getCbillCode(), "cbillCode must be preserved through the update mapper");
}

@Test
void updateCreditorInstitution_ko() throws IOException {
FeignException feignException = mock(FeignException.InternalServerError.class);
Expand Down
Loading