diff --git a/web/src/main/java/it/pagopa/selfcare/mscore/web/model/mapper/InstitutionMapperCustom.java b/web/src/main/java/it/pagopa/selfcare/mscore/web/model/mapper/InstitutionMapperCustom.java index 9ced076f..6bec85f1 100644 --- a/web/src/main/java/it/pagopa/selfcare/mscore/web/model/mapper/InstitutionMapperCustom.java +++ b/web/src/main/java/it/pagopa/selfcare/mscore/web/model/mapper/InstitutionMapperCustom.java @@ -481,6 +481,7 @@ private static Map toOnboardingMap(List 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); diff --git a/web/src/test/java/it/pagopa/selfcare/mscore/web/controller/InstitutionControllerTest.java b/web/src/test/java/it/pagopa/selfcare/mscore/web/controller/InstitutionControllerTest.java index a44c8131..4ece7fd7 100644 --- a/web/src/test/java/it/pagopa/selfcare/mscore/web/controller/InstitutionControllerTest.java +++ b/web/src/test/java/it/pagopa/selfcare/mscore/web/controller/InstitutionControllerTest.java @@ -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) @@ -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);