diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/messaging/CommandsHandler.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/messaging/CommandsHandler.java index 651199b..73a1c1b 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/messaging/CommandsHandler.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/messaging/CommandsHandler.java @@ -6,12 +6,12 @@ import it.vincenzocorso.carsharing.common.messaging.commands.CommandHeaders; import it.vincenzocorso.carsharing.common.messaging.commands.CommandProducer; import it.vincenzocorso.carsharing.customerservice.domain.ports.in.RentVehicle; +import jakarta.enterprise.context.ApplicationScoped; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.microprofile.reactive.messaging.Incoming; import org.eclipse.microprofile.reactive.messaging.Message; -import javax.enterprise.context.ApplicationScoped; import java.util.concurrent.CompletionStage; @ApplicationScoped diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerDocumentMapper.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerDocumentMapper.java index 862aee7..6f6227c 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerDocumentMapper.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerDocumentMapper.java @@ -3,10 +3,9 @@ import it.vincenzocorso.carsharing.customerservice.domain.models.Customer; import it.vincenzocorso.carsharing.customerservice.domain.models.CustomerDetails; import it.vincenzocorso.carsharing.customerservice.domain.models.DriverLicense; +import jakarta.enterprise.context.ApplicationScoped; import org.bson.types.ObjectId; -import javax.enterprise.context.ApplicationScoped; - @ApplicationScoped public class CustomerDocumentMapper { public CustomerDocument convertToDocument(Customer customer) { diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerMongoRepositoryAdapter.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerMongoRepositoryAdapter.java index 9960df6..27f980f 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerMongoRepositoryAdapter.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/persistence/mongodb/CustomerMongoRepositoryAdapter.java @@ -4,9 +4,9 @@ import it.vincenzocorso.carsharing.customerservice.domain.models.Customer; import it.vincenzocorso.carsharing.customerservice.domain.models.SearchCustomerCriteria; import it.vincenzocorso.carsharing.customerservice.domain.ports.out.CustomerRepository; +import jakarta.enterprise.context.ApplicationScoped; import org.bson.types.ObjectId; -import javax.enterprise.context.ApplicationScoped; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerController.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerController.java index 0b26e3a..f13c6d5 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerController.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerController.java @@ -5,12 +5,13 @@ import it.vincenzocorso.carsharing.customerservice.domain.models.SearchCustomerCriteria; import it.vincenzocorso.carsharing.customerservice.domain.ports.in.RegisterCustomer; import it.vincenzocorso.carsharing.customerservice.domain.ports.in.SearchCustomer; +import jakarta.ws.rs.core.Response; import lombok.AllArgsConstructor; -import javax.ws.rs.core.Response; import java.util.List; -import static javax.ws.rs.core.Response.Status.*; +import static jakarta.ws.rs.core.Response.Status.CREATED; +import static jakarta.ws.rs.core.Response.Status.OK; @AllArgsConstructor public class CustomerController implements CustomerRestApi { diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerMapper.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerMapper.java index 18fde66..914848c 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerMapper.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerMapper.java @@ -3,8 +3,7 @@ import it.vincenzocorso.carsharing.customerservice.domain.models.Customer; import it.vincenzocorso.carsharing.customerservice.domain.models.CustomerDetails; import it.vincenzocorso.carsharing.customerservice.domain.models.DriverLicense; - -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped public class CustomerMapper { diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerNotFoundExceptionHandler.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerNotFoundExceptionHandler.java index 6e1d8bf..d4c6126 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerNotFoundExceptionHandler.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerNotFoundExceptionHandler.java @@ -4,10 +4,10 @@ import it.vincenzocorso.carsharing.common.web.ErrorResponses; import it.vincenzocorso.carsharing.common.web.Issue; import it.vincenzocorso.carsharing.customerservice.domain.exceptions.CustomerNotFoundException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; import java.util.List; @Provider diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerRestApi.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerRestApi.java index b09373c..b6bfe08 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerRestApi.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerRestApi.java @@ -1,11 +1,11 @@ package it.vincenzocorso.carsharing.customerservice.adapters.web; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; @Path("/customers") @Produces(MediaType.APPLICATION_JSON) diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/DriverLicenseDetails.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/DriverLicenseDetails.java index 93b9885..0202e13 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/DriverLicenseDetails.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/DriverLicenseDetails.java @@ -1,11 +1,11 @@ package it.vincenzocorso.carsharing.customerservice.adapters.web; +import jakarta.validation.constraints.Future; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Past; import lombok.Builder; -import javax.validation.constraints.Future; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Past; import java.time.LocalDate; @Builder diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/RegisterCustomerRequest.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/RegisterCustomerRequest.java index 71df3d2..700a011 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/RegisterCustomerRequest.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/RegisterCustomerRequest.java @@ -1,8 +1,8 @@ package it.vincenzocorso.carsharing.customerservice.adapters.web; +import jakarta.validation.constraints.*; import lombok.Builder; -import javax.validation.constraints.*; import java.time.LocalDate; @Builder diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/ValidationExceptionHandler.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/ValidationExceptionHandler.java index 518641f..7d9ba0b 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/ValidationExceptionHandler.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/adapters/web/ValidationExceptionHandler.java @@ -3,13 +3,13 @@ import it.vincenzocorso.carsharing.common.web.ErrorResponse; import it.vincenzocorso.carsharing.common.web.ErrorResponses; import it.vincenzocorso.carsharing.common.web.Issue; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Path; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.Path; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; import java.util.Iterator; import java.util.List; diff --git a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/config/BeansConfig.java b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/config/BeansConfig.java index f6ec979..b270983 100644 --- a/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/config/BeansConfig.java +++ b/customer-service/src/main/java/it/vincenzocorso/carsharing/customerservice/config/BeansConfig.java @@ -4,9 +4,8 @@ import it.vincenzocorso.carsharing.customerservice.adapters.web.ValidationExceptionHandler; import it.vincenzocorso.carsharing.customerservice.domain.CustomerService; import it.vincenzocorso.carsharing.customerservice.domain.ports.out.CustomerRepository; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; @ApplicationScoped public class BeansConfig { diff --git a/customer-service/src/test/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerControllerTest.java b/customer-service/src/test/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerControllerTest.java index d7dc4a5..3bdca39 100644 --- a/customer-service/src/test/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerControllerTest.java +++ b/customer-service/src/test/java/it/vincenzocorso/carsharing/customerservice/adapters/web/CustomerControllerTest.java @@ -8,22 +8,23 @@ import it.vincenzocorso.carsharing.customerservice.domain.models.SearchCustomerCriteria; import it.vincenzocorso.carsharing.customerservice.domain.ports.in.RegisterCustomer; import it.vincenzocorso.carsharing.customerservice.domain.ports.in.SearchCustomer; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.MediaType; import org.apache.http.HttpStatus; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import javax.inject.Inject; -import javax.ws.rs.core.MediaType; - import java.util.List; -import static io.restassured.RestAssured.*; +import static io.restassured.RestAssured.given; +import static it.vincenzocorso.carsharing.customerservice.adapters.web.FakeCustomerDto.CUSTOMER_RESPONSE; +import static it.vincenzocorso.carsharing.customerservice.adapters.web.FakeCustomerDto.REGISTER_CUSTOMER_REQUEST; import static it.vincenzocorso.carsharing.customerservice.domain.FakeCustomer.*; -import static it.vincenzocorso.carsharing.customerservice.adapters.web.FakeCustomerDto.*; -import static org.assertj.core.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.when; @QuarkusTest class CustomerControllerTest {