diff --git a/openapi/openapi.json b/openapi/openapi.json index 1ce20d3..c9043b2 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -85,7 +85,7 @@ } ], "post": { - "operationId": "createMdbPaymentOption", + "operationId": "buildMdbPaymentOption", "requestBody": { "content": { "application/json": { @@ -215,7 +215,7 @@ "ApiKey": [] } ], - "summary": "Create MBD payment option", + "summary": "Build MBD payment option model", "tags": [ "MBD GPS" ] diff --git a/src/main/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsController.java b/src/main/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsController.java index c72bb1e..30c1fb1 100644 --- a/src/main/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsController.java +++ b/src/main/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsController.java @@ -81,9 +81,9 @@ public MbdGpsController(ModelMapper modelMapper) { schema = @Schema(implementation = ProblemJson.class))) }) @Operation( - summary = "Create MBD payment option", + summary = "Build MBD payment option model", security = {@SecurityRequirement(name = "ApiKey")}) - public @Valid MbdPaymentOptionResponse createMdbPaymentOption( + public @Valid MbdPaymentOptionResponse buildMdbPaymentOption( @RequestBody @NotNull @Valid MbdPaymentOptionRequest mbdPaymentOptionRequest) { return this.modelMapper.map(mbdPaymentOptionRequest, MbdPaymentOptionResponse.class); } diff --git a/src/test/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsControllerTest.java b/src/test/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsControllerTest.java index 69f6fed..30e4084 100644 --- a/src/test/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsControllerTest.java +++ b/src/test/java/it/gov/pagopa/mbd/gps/service/controller/MbdGpsControllerTest.java @@ -30,8 +30,8 @@ class MbdGpsControllerTest { @Autowired private ObjectMapper objectMapper; @Test - void createMdbPaymentOptionTestSuccess() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestSuccess() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); MvcResult result = mvc.perform( @@ -78,8 +78,8 @@ void createMdbPaymentOptionTestSuccess() throws Exception { } @Test - void createMdbPaymentOptionTestFailAmountMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailAmountMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setAmount(null); mvc.perform( @@ -90,8 +90,8 @@ void createMdbPaymentOptionTestFailAmountMissing() throws Exception { } @Test - void createMdbPaymentOptionTestFailFirstNameMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailFirstNameMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setFirstName(null); mvc.perform( @@ -102,8 +102,8 @@ void createMdbPaymentOptionTestFailFirstNameMissing() throws Exception { } @Test - void createMdbPaymentOptionTestFailLastNameMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailLastNameMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setLastName(null); mvc.perform( @@ -114,8 +114,8 @@ void createMdbPaymentOptionTestFailLastNameMissing() throws Exception { } @Test - void createMdbPaymentOptionTestFailFiscalCodeMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailFiscalCodeMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setFiscalCode(null); mvc.perform( @@ -126,8 +126,8 @@ void createMdbPaymentOptionTestFailFiscalCodeMissing() throws Exception { } @Test - void createMdbPaymentOptionTestFailProvincialResidenceMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailProvincialResidenceMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setProvincialResidence(null); mvc.perform( @@ -138,8 +138,8 @@ void createMdbPaymentOptionTestFailProvincialResidenceMissing() throws Exception } @Test - void createMdbPaymentOptionTestFailDocumentHashMissing() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailDocumentHashMissing() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setDocumentHash(null); mvc.perform( @@ -150,8 +150,8 @@ void createMdbPaymentOptionTestFailDocumentHashMissing() throws Exception { } @Test - void createMdbPaymentOptionTestFailDocumentHashWrongSize() throws Exception { - MbdPaymentOptionRequest request = buildMdbPaymentOptionRequest(); + void buildMbdPaymentOptionTestFailDocumentHashWrongSize() throws Exception { + MbdPaymentOptionRequest request = buildMbdPaymentOptionRequest(); request.getProperties().setDocumentHash("asdfsdf"); mvc.perform( @@ -161,7 +161,7 @@ void createMdbPaymentOptionTestFailDocumentHashWrongSize() throws Exception { .andExpect(status().is4xxClientError()); } - private MbdPaymentOptionRequest buildMdbPaymentOptionRequest() { + private MbdPaymentOptionRequest buildMbdPaymentOptionRequest() { return MbdPaymentOptionRequest.builder() .properties( MbdPaymentOptionRequestProperties.builder()