### Question:
TravelServiceImpl implements TravelService { @Override public Response retrieve(String tripId, HttpHeaders headers) { TripId ti = new TripId(tripId); Trip trip = repository.findByTripId(ti); if (trip != null) { return new Response<>(1, "Search Trip Success by Trip Id " + tripId, trip); } else { return new Response<>(0, "No Content according to tripId" + tripId, null); } }  @Override Response create(TravelInfo info, HttpHeaders headers); @Override Response getRouteByTripId(String tripId, HttpHeaders headers); @Override Response getTrainTypeByTripId(String tripId, HttpHeaders headers); @Override Response getTripByRoute(ArrayList<String> routeIds, HttpHeaders headers); @Override Response retrieve(String tripId, HttpHeaders headers); @Override Response update(TravelInfo info, HttpHeaders headers); @Override Response delete(String tripId, HttpHeaders headers); @Override Response query(TripInfo info, HttpHeaders headers); @Override Response getTripAllDetailInfo(TripAllDetailInfo gtdi, HttpHeaders headers); @Override Response queryAll(HttpHeaders headers); @Override Response adminQueryAll(HttpHeaders headers);  }### Answer:
@Test public void testRetrieve1() { Trip trip = new Trip(); Mockito.when(repository.findByTripId(Mockito.any(TripId.class))).thenReturn(trip); Response result = travelServiceImpl.retrieve("trip_id_1", headers); Assert.assertEquals(new Response<>(1, "Search Trip Success by Trip Id trip_id_1", trip), result); }
@Test public void testRetrieve2() { Trip trip = new Trip(); Mockito.when(repository.findByTripId(Mockito.any(TripId.class))).thenReturn(trip); Response result = travelServiceImpl.retrieve("trip_id_1", headers); Assert.assertEquals(new Response<>(1, "Search Trip Success by Trip Id trip_id_1", trip), result); }