Skip to content

Commit

Permalink
Fix vehicle location response (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushroshan authored Mar 20, 2024
1 parent daef452 commit 8ac6134
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ac6134

Please sign in to comment.