### Question:
TravelServiceImpl implements TravelService { @Override public Response queryAll(HttpHeaders headers) { List<Trip> tripList = repository.findAll(); if (tripList != null && !tripList.isEmpty()) { return new Response<>(1, success, tripList); } return new Response<>(0, noContent, 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 testQueryAll1() { ArrayList<Trip> tripList = new ArrayList<>(); tripList.add(new Trip()); Mockito.when(repository.findAll()).thenReturn(tripList); Response result = travelServiceImpl.queryAll(headers); Assert.assertEquals(new Response<>(1, success, tripList), result); }
@Test public void testQueryAll2() { Mockito.when(repository.findAll()).thenReturn(null); Response result = travelServiceImpl.queryAll(headers); Assert.assertEquals(new Response<>(0, noCnontent, null), result); }