diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/controller/BookingController.java b/cab-admin/src/main/java/in/rsh/cab/admin/controller/BookingController.java index 92f76c8..deb30ec 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/controller/BookingController.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/controller/BookingController.java @@ -4,8 +4,8 @@ import com.google.gson.GsonBuilder; import in.rsh.cab.admin.model.request.BookCabRequest; import in.rsh.cab.admin.service.BookingService; -import in.rsh.cab.commons.adapter.*; -import java.time.LocalDateTime; +import in.rsh.cab.commons.adapter.LocalDateTimeDeserializer; +import in.rsh.cab.commons.adapter.LocalDateTimeSerializer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; @@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import java.time.LocalDateTime; + @RestController public class BookingController { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/controller/CabController.java b/cab-admin/src/main/java/in/rsh/cab/admin/controller/CabController.java index 5588065..4b824a0 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/controller/CabController.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/controller/CabController.java @@ -1,7 +1,5 @@ package in.rsh.cab.admin.controller; -import static in.rsh.cab.commons.model.Cab.*; - import com.google.gson.Gson; import in.rsh.cab.admin.model.request.AddCabRequest; import in.rsh.cab.admin.model.request.UpdateCabRequest; @@ -15,6 +13,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import static in.rsh.cab.commons.model.Cab.CabStatus; + @RestController public class CabController { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/model/request/UpdateCabRequest.java b/cab-admin/src/main/java/in/rsh/cab/admin/model/request/UpdateCabRequest.java index f180147..247853b 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/model/request/UpdateCabRequest.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/model/request/UpdateCabRequest.java @@ -1,6 +1,6 @@ package in.rsh.cab.admin.model.request; -import static in.rsh.cab.commons.model.Cab.*; +import static in.rsh.cab.commons.model.Cab.CabStatus; public record UpdateCabRequest(String state, Integer cityId) { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/service/BookingService.java b/cab-admin/src/main/java/in/rsh/cab/admin/service/BookingService.java index 36b508d..27fc4d9 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/service/BookingService.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/service/BookingService.java @@ -3,10 +3,11 @@ import in.rsh.cab.admin.store.BookingStore; import in.rsh.cab.commons.model.Booking; import in.rsh.cab.commons.model.Cab; -import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Collection; + @Service public class BookingService { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/service/CabService.java b/cab-admin/src/main/java/in/rsh/cab/admin/service/CabService.java index c639ca8..d31cc9a 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/service/CabService.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/service/CabService.java @@ -1,14 +1,15 @@ package in.rsh.cab.admin.service; -import static in.rsh.cab.commons.model.Cab.*; - import in.rsh.cab.admin.store.CabStore; import in.rsh.cab.commons.model.Cab; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; + +import static in.rsh.cab.commons.model.Cab.CabStatus; @Service public class CabService { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/service/CityService.java b/cab-admin/src/main/java/in/rsh/cab/admin/service/CityService.java index fc7da18..736445b 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/service/CityService.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/service/CityService.java @@ -2,10 +2,11 @@ import in.rsh.cab.admin.model.City; import in.rsh.cab.admin.store.CityStore; -import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Collection; + @Service public class CityService { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/store/BookingStore.java b/cab-admin/src/main/java/in/rsh/cab/admin/store/BookingStore.java index f17e5d9..1b9d966 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/store/BookingStore.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/store/BookingStore.java @@ -2,11 +2,12 @@ import in.rsh.cab.commons.model.Booking; import in.rsh.cab.commons.model.Location; +import org.springframework.stereotype.Service; + import java.time.LocalDateTime; import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.springframework.stereotype.Service; @Service public class BookingStore { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/store/CabStore.java b/cab-admin/src/main/java/in/rsh/cab/admin/store/CabStore.java index c1e193c..79a49de 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/store/CabStore.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/store/CabStore.java @@ -1,12 +1,13 @@ package in.rsh.cab.admin.store; -import static in.rsh.cab.commons.model.Cab.*; - import in.rsh.cab.commons.model.Cab; +import org.springframework.stereotype.Service; + import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.springframework.stereotype.Service; + +import static in.rsh.cab.commons.model.Cab.CabStatus; @Service public class CabStore { diff --git a/cab-admin/src/main/java/in/rsh/cab/admin/store/CityStore.java b/cab-admin/src/main/java/in/rsh/cab/admin/store/CityStore.java index 01266ed..de605cd 100644 --- a/cab-admin/src/main/java/in/rsh/cab/admin/store/CityStore.java +++ b/cab-admin/src/main/java/in/rsh/cab/admin/store/CityStore.java @@ -1,10 +1,11 @@ package in.rsh.cab.admin.store; import in.rsh.cab.admin.model.City; +import org.springframework.stereotype.Service; + import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.springframework.stereotype.Service; @Service public class CityStore { diff --git a/cab-admin/src/test/java/in/rsh/cab/admin/controller/BookingControllerTest.java b/cab-admin/src/test/java/in/rsh/cab/admin/controller/BookingControllerTest.java index a77d4f7..679da95 100644 --- a/cab-admin/src/test/java/in/rsh/cab/admin/controller/BookingControllerTest.java +++ b/cab-admin/src/test/java/in/rsh/cab/admin/controller/BookingControllerTest.java @@ -1,21 +1,12 @@ package in.rsh.cab.admin.controller; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.hasSize; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import in.rsh.cab.admin.model.request.AddCabRequest; import in.rsh.cab.admin.model.request.AddCityRequest; import in.rsh.cab.admin.model.request.BookCabRequest; import in.rsh.cab.commons.adapter.LocalDateTimeDeserializer; import in.rsh.cab.commons.adapter.LocalDateTimeSerializer; -import java.time.LocalDateTime; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -25,6 +16,17 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; +import java.time.LocalDateTime; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.hasSize; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + @ExtendWith(SpringExtension.class) @SpringBootTest @AutoConfigureMockMvc diff --git a/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeDeserializer.java b/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeDeserializer.java index 9513467..03714b8 100644 --- a/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeDeserializer.java +++ b/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeDeserializer.java @@ -4,6 +4,7 @@ import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; + import java.lang.reflect.Type; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; diff --git a/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeSerializer.java b/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeSerializer.java index fa64113..9d10278 100644 --- a/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeSerializer.java +++ b/cab-commons/src/main/java/in/rsh/cab/commons/adapter/LocalDateTimeSerializer.java @@ -4,6 +4,7 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; + import java.lang.reflect.Type; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; diff --git a/cab-commons/src/main/java/in/rsh/cab/commons/model/Booking.java b/cab-commons/src/main/java/in/rsh/cab/commons/model/Booking.java index 8f27f13..375a81a 100644 --- a/cab-commons/src/main/java/in/rsh/cab/commons/model/Booking.java +++ b/cab-commons/src/main/java/in/rsh/cab/commons/model/Booking.java @@ -1,9 +1,10 @@ package in.rsh.cab.commons.model; -import java.time.LocalDateTime; import lombok.Builder; import lombok.Getter; +import java.time.LocalDateTime; + @Getter @Builder public class Booking { diff --git a/cab-user/src/main/java/in/rsh/cab/user/service/BookingService.java b/cab-user/src/main/java/in/rsh/cab/user/service/BookingService.java index 87b31d8..252bbe0 100644 --- a/cab-user/src/main/java/in/rsh/cab/user/service/BookingService.java +++ b/cab-user/src/main/java/in/rsh/cab/user/service/BookingService.java @@ -1,13 +1,14 @@ package in.rsh.cab.user.service; -import in.rsh.cab.user.exception.CabNotAvailableException; import in.rsh.cab.commons.model.Booking; import in.rsh.cab.commons.model.Cab; import in.rsh.cab.commons.model.Location; +import in.rsh.cab.user.exception.CabNotAvailableException; import in.rsh.cab.user.model.Rider; import in.rsh.cab.user.store.GenericStore; import in.rsh.cab.user.store.StoreFactory; import in.rsh.cab.user.util.IDUtil; + import java.time.LocalDateTime; import java.util.List; import java.util.Optional; diff --git a/cab-user/src/main/java/in/rsh/cab/user/service/CabService.java b/cab-user/src/main/java/in/rsh/cab/user/service/CabService.java index c3bae30..bd4ed3b 100644 --- a/cab-user/src/main/java/in/rsh/cab/user/service/CabService.java +++ b/cab-user/src/main/java/in/rsh/cab/user/service/CabService.java @@ -6,6 +6,7 @@ import in.rsh.cab.user.store.GenericStore; import in.rsh.cab.user.store.StoreFactory; import in.rsh.cab.user.util.IDUtil; + import java.util.Optional; public class CabService { diff --git a/cab-user/src/main/java/in/rsh/cab/user/store/StoreFactory.java b/cab-user/src/main/java/in/rsh/cab/user/store/StoreFactory.java index 149bc25..ef8e7ba 100644 --- a/cab-user/src/main/java/in/rsh/cab/user/store/StoreFactory.java +++ b/cab-user/src/main/java/in/rsh/cab/user/store/StoreFactory.java @@ -4,6 +4,7 @@ import in.rsh.cab.commons.model.Cab; import in.rsh.cab.commons.model.Driver; import in.rsh.cab.user.model.Rider; + import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; diff --git a/cab-user/src/test/java/in/rsh/cab/user/service/BookingServiceTest.java b/cab-user/src/test/java/in/rsh/cab/user/service/BookingServiceTest.java index 38ef9b2..3aaddce 100644 --- a/cab-user/src/test/java/in/rsh/cab/user/service/BookingServiceTest.java +++ b/cab-user/src/test/java/in/rsh/cab/user/service/BookingServiceTest.java @@ -1,7 +1,5 @@ package in.rsh.cab.user.service; -import static org.junit.jupiter.api.Assertions.assertEquals; - import in.rsh.cab.commons.model.Booking; import in.rsh.cab.commons.model.Cab; import in.rsh.cab.commons.model.Driver; @@ -10,6 +8,8 @@ import in.rsh.cab.user.model.Rider; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + class BookingServiceTest { private final BookingService bookingService = new BookingService(); diff --git a/cab-user/src/test/java/in/rsh/cab/user/service/DriverServiceTest.java b/cab-user/src/test/java/in/rsh/cab/user/service/DriverServiceTest.java index e8d64b9..938f1a5 100644 --- a/cab-user/src/test/java/in/rsh/cab/user/service/DriverServiceTest.java +++ b/cab-user/src/test/java/in/rsh/cab/user/service/DriverServiceTest.java @@ -1,11 +1,11 @@ package in.rsh.cab.user.service; -import static org.junit.jupiter.api.Assertions.assertEquals; - import in.rsh.cab.commons.model.Driver; import in.rsh.cab.commons.model.DrivingLicense; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + class DriverServiceTest { private final DriverService driverService = new DriverService(); diff --git a/cab-user/src/test/java/in/rsh/cab/user/service/RiderServiceTest.java b/cab-user/src/test/java/in/rsh/cab/user/service/RiderServiceTest.java index 5040899..168032f 100644 --- a/cab-user/src/test/java/in/rsh/cab/user/service/RiderServiceTest.java +++ b/cab-user/src/test/java/in/rsh/cab/user/service/RiderServiceTest.java @@ -1,10 +1,10 @@ package in.rsh.cab.user.service; -import static org.junit.jupiter.api.Assertions.assertEquals; - import in.rsh.cab.user.model.Rider; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + class RiderServiceTest { private final RiderService riderService = new RiderService();