Skip to content

Commit

Permalink
[SELC-4864] Feat: mapped institution taxCode in brokerInfo code (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminiaScarciofolo authored May 10, 2024
1 parent 2cc315a commit 89d94f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions connector/rest/docs/openapi/api-selfcare-core-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4450,6 +4450,9 @@
"numberOfDelegations" : {
"type" : "integer",
"format" : "int32"
},
"taxCode" : {
"type" : "string"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface BrokerMapper {
@Mapping(source = "id", target = "code")
BrokerInfo fromInstitution(Institution institution);

@Mapping(source = "id", target = "code")
@Mapping(source = "taxCode", target = "code")
BrokerInfo fromInstitution(BrokerResponse institutions);

List<BrokerInfo> fromInstitutions(List<BrokerResponse> institutions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,12 @@ void findInstitutionsByProductIdAndType() {
// given
final String productId = "prod";
final String type = "PT";
Institution institution = new Institution();
institution.setId("id");
institution.setDescription("description");
BrokerInfo brokerInfo = new BrokerInfo();
brokerInfo.setCode("id");
brokerInfo.setCode("taxCode");
brokerInfo.setDescription("description");
BrokerResponse brokerResponse = new BrokerResponse();
brokerResponse.setDescription("description");
brokerResponse.setTaxCode("taxCode");
when(brokerMapper.fromInstitutions(anyList())).thenReturn(List.of(brokerInfo));
when(coreInstitutionApiRestClient._getInstitutionBrokersUsingGET(any(), any()))
.thenReturn(ResponseEntity.of(Optional.of(List.of(brokerResponse))));
Expand All @@ -274,8 +272,8 @@ void findInstitutionsByProductIdAndType() {
assertNotNull(response);
assertEquals(1, response.size());
assertNotNull(response.get(0));
assertEquals(response.get(0).getCode(), institution.getId());
assertEquals(response.get(0).getDescription(), institution.getDescription());
assertEquals(response.get(0).getCode(), brokerInfo.getCode());
assertEquals(response.get(0).getDescription(), brokerResponse.getDescription());

}

Expand Down

0 comments on commit 89d94f9

Please sign in to comment.