diff --git a/services/identity/src/main/java/com/crapi/model/VehicleLocationResponse.java b/services/identity/src/main/java/com/crapi/model/VehicleLocationResponse.java index 20a28199..ab9bedcd 100644 --- a/services/identity/src/main/java/com/crapi/model/VehicleLocationResponse.java +++ b/services/identity/src/main/java/com/crapi/model/VehicleLocationResponse.java @@ -24,12 +24,15 @@ public class VehicleLocationResponse { private UUID carId; private VehicleLocation vehicleLocation; private String fullName; + private String email; public VehicleLocationResponse() {} - public VehicleLocationResponse(UUID id, String name, VehicleLocation vehicleLocation) { + public VehicleLocationResponse( + UUID id, String name, String email, VehicleLocation vehicleLocation) { this.carId = id; this.fullName = name; + this.email = email; this.vehicleLocation = vehicleLocation; } } diff --git a/services/identity/src/main/java/com/crapi/service/Impl/VehicleServiceImpl.java b/services/identity/src/main/java/com/crapi/service/Impl/VehicleServiceImpl.java index 2a653158..a1edb374 100644 --- a/services/identity/src/main/java/com/crapi/service/Impl/VehicleServiceImpl.java +++ b/services/identity/src/main/java/com/crapi/service/Impl/VehicleServiceImpl.java @@ -160,6 +160,7 @@ public VehicleLocationResponse getVehicleLocation(UUID carId) { new VehicleLocationResponse( carId, (userDetails != null ? userDetails.getName() : null), + (userDetails != null ? userDetails.getUser().getEmail() : null), vehicleDetails.getVehicleLocation()); return vehicleLocationForm; } diff --git a/services/identity/src/test/java/com/crapi/service/Impl/VehicleServiceImplTest.java b/services/identity/src/test/java/com/crapi/service/Impl/VehicleServiceImplTest.java index 95da2868..f4e62f17 100644 --- a/services/identity/src/test/java/com/crapi/service/Impl/VehicleServiceImplTest.java +++ b/services/identity/src/test/java/com/crapi/service/Impl/VehicleServiceImplTest.java @@ -143,6 +143,7 @@ public void getVehicleLocationSuccessWithUserDetailsNotNull() { vehicleService.getVehicleLocation(vehicleDetails.getUuid()); Assertions.assertNotNull(vehicleLocationResponse); Assertions.assertEquals(userDetails.getName(), vehicleLocationResponse.getFullName()); + Assertions.assertEquals(userDetails.getUser().getEmail(), vehicleLocationResponse.getEmail()); } @Test