From 3b4122bf89b81f6e92c8b83de2dc473ce02ba835 Mon Sep 17 00:00:00 2001 From: empassaro <113031808+empassaro@users.noreply.github.com> Date: Fri, 31 May 2024 11:18:54 +0200 Subject: [PATCH] [SELC-4993] feat: added istatCode in InstitutionResponse (#503) --- app/src/main/resources/swagger/api-docs.json | 3 +++ .../mscore/web/model/institution/InstitutionResponse.java | 1 + .../mscore/web/controller/InstitutionControllerTest.java | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/resources/swagger/api-docs.json b/app/src/main/resources/swagger/api-docs.json index 44779d6ab..91700c485 100644 --- a/app/src/main/resources/swagger/api-docs.json +++ b/app/src/main/resources/swagger/api-docs.json @@ -3401,6 +3401,9 @@ "type" : "string", "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, + "istatCode" : { + "type" : "string" + }, "onboarding" : { "type" : "array", "items" : { diff --git a/web/src/main/java/it/pagopa/selfcare/mscore/web/model/institution/InstitutionResponse.java b/web/src/main/java/it/pagopa/selfcare/mscore/web/model/institution/InstitutionResponse.java index f87cca22d..a6d090699 100644 --- a/web/src/main/java/it/pagopa/selfcare/mscore/web/model/institution/InstitutionResponse.java +++ b/web/src/main/java/it/pagopa/selfcare/mscore/web/model/institution/InstitutionResponse.java @@ -29,6 +29,7 @@ public class InstitutionResponse { private String city; private String county; private String country; + private String istatCode; private List geographicTaxonomies; private List attributes; private List onboarding; 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 2060f11e7..ebcb01283 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 @@ -108,6 +108,7 @@ class InstitutionControllerTest { institution.setDescription("description"); institution.setOnboarding(List.of(onboarding)); institution.setAttributes(List.of(attribute)); + institution.setIstatCode("istatCode"); } @@ -285,7 +286,7 @@ void testRetrieveInstitutionById() throws Exception { .perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json")) - .andExpect(MockMvcResultMatchers.content().string("{\"id\":\"42\",\"description\":\"description\",\"institutionType\":\"PG\",\"attributes\":[{\"origin\":null,\"code\":\"code\",\"description\":\"description\"}],\"onboarding\":[{\"productId\":\"example\",\"status\":\"ACTIVE\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null}],\"imported\":false,\"delegation\":false}")); + .andExpect(MockMvcResultMatchers.content().string("{\"id\":\"42\",\"description\":\"description\",\"institutionType\":\"PG\",\"istatCode\":\"istatCode\",\"attributes\":[{\"origin\":null,\"code\":\"code\",\"description\":\"description\"}],\"onboarding\":[{\"productId\":\"example\",\"status\":\"ACTIVE\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null}],\"imported\":false,\"delegation\":false}")); } @Test