Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
feat: add isAggregation in findFromProduct API response
Browse files Browse the repository at this point in the history
  • Loading branch information
giulia-tremolada committed Jun 5, 2024
1 parent 290af7d commit a520ae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ private static Map<String, OnboardingResponse> toOnboardingMap(List<Onboarding>
onboardingResponse.setCreatedAt(o.getCreatedAt());
onboardingResponse.setUpdatedAt(o.getUpdatedAt());
onboardingResponse.setClosedAt(o.getClosedAt());
onboardingResponse.setIsAggregator(o.getIsAggregator());
if (!map.containsKey(o.getProductId()) ||
map.containsKey(o.getProductId()) && map.get(o.getProductId()).getStatus() != RelationshipState.ACTIVE) {
map.put(o.getProductId(), onboardingResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,6 @@ void findFromProduct() throws Exception {
Integer pageMock = 0;
Integer sizeMock = 2;

Institution institution = new Institution();
institution.setId("id");

// When
when(institutionService.getInstitutionsByProductId(any(), any(), any())).thenReturn(List.of(institution));
MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(BASE_URL + "/products/{productId}", productIdMock)
Expand All @@ -1251,7 +1248,9 @@ void findFromProduct() throws Exception {
.perform(requestBuilder);
actualPerformResult
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.content().contentType("application/json"));
.andExpect(MockMvcResultMatchers.content().contentType("application/json"))
.andExpect(MockMvcResultMatchers.content()
.string("{\"items\":[{\"id\":\"42\",\"externalId\":null,\"origin\":null,\"originId\":null,\"description\":\"description\",\"institutionType\":\"PG\",\"digitalAddress\":null,\"address\":null,\"zipCode\":null,\"taxCode\":null,\"onboardings\":{\"example\":{\"productId\":\"example\",\"tokenId\":\"tokenId\",\"status\":\"ACTIVE\",\"contract\":\"contract\",\"pricingPlan\":\"setPricingPlan\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null,\"closedAt\":null,\"isAggregator\":true}},\"geographicTaxonomies\":null,\"attributes\":[{\"origin\":null,\"code\":\"code\",\"description\":\"description\"}],\"paymentServiceProvider\":null,\"dataProtectionOfficer\":null,\"rea\":null,\"shareCapital\":null,\"businessRegisterPlace\":null,\"supportEmail\":null,\"supportPhone\":null,\"imported\":false,\"subunitCode\":null,\"subunitType\":null,\"aooParentCode\":null,\"createdAt\":null,\"updatedAt\":null}]}"));;
// Then
verify(institutionService, times(1))
.getInstitutionsByProductId(productIdMock, pageMock, sizeMock);
Expand Down

0 comments on commit a520ae3

Please sign in to comment.