diff --git a/src/main/java/it/gov/pagopa/rtp/activator/controller/SendAPIControllerImpl.java b/src/main/java/it/gov/pagopa/rtp/activator/controller/SendAPIControllerImpl.java index 35d91ae..ce5a2a8 100644 --- a/src/main/java/it/gov/pagopa/rtp/activator/controller/SendAPIControllerImpl.java +++ b/src/main/java/it/gov/pagopa/rtp/activator/controller/SendAPIControllerImpl.java @@ -27,8 +27,8 @@ public SendAPIControllerImpl(SendRTPService sendRTPService, RtpMapper rtpMapper) public Mono> createRtp(Mono createRtpDto, ServerWebExchange exchange) { return createRtpDto - .map(rtpDto -> rtpMapper.toRtp(rtpDto)) - .flatMap(rtp -> sendRTPService.send(rtp)) + .map(rtpMapper::toRtp) + .flatMap(sendRTPService::send) .thenReturn(ResponseEntity.status(201).build()); } } diff --git a/src/test/java/it/gov/pagopa/rtp/activator/domain/rtp/RtpMapperTest.java b/src/test/java/it/gov/pagopa/rtp/activator/domain/rtp/RtpMapperTest.java index 13ba5fd..2d25abd 100644 --- a/src/test/java/it/gov/pagopa/rtp/activator/domain/rtp/RtpMapperTest.java +++ b/src/test/java/it/gov/pagopa/rtp/activator/domain/rtp/RtpMapperTest.java @@ -8,16 +8,16 @@ import java.time.LocalDate; import static org.assertj.core.api.Assertions.assertThat; -public class RtpMapperTest { +class RtpMapperTest { private RtpMapper rtpMapper; @BeforeEach - public void setUp() { + void setUp() { rtpMapper = new RtpMapper(); } @Test - public void testToRtp() { + void testToRtp() { CreateRtpDto createRtpDto = new CreateRtpDto(); createRtpDto.setNoticeNumber("12345"); createRtpDto.setAmount(BigDecimal.valueOf(100));