### Question:
AdminTravelServiceImpl implements AdminTravelService { @Override public Response deleteTravel(String tripId, HttpHeaders headers) { Response result; String requestUtl = ""; if (tripId.charAt(0) == 'G' || tripId.charAt(0) == 'D') { requestUtl = "http: } else { requestUtl = "http: } HttpEntity requestEntity = new HttpEntity(headers); ResponseEntity<Response> re = restTemplate.exchange( requestUtl, HttpMethod.DELETE, requestEntity, Response.class); result = re.getBody(); return result; }  @Override Response getAllTravels(HttpHeaders headers); @Override Response addTravel(TravelInfo request, HttpHeaders headers); @Override Response updateTravel(TravelInfo request, HttpHeaders headers); @Override Response deleteTravel(String tripId, HttpHeaders headers);  }### Answer:
@Test public void testDeleteTravel1() { Response response = new Response(); ResponseEntity<Response> re = new ResponseEntity<>(response, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.DELETE, requestEntity, Response.class)).thenReturn(re); Response result = adminTravelServiceImpl.deleteTravel("GaoTie", headers); Assert.assertEquals(new Response<>(null, null, null), result); }
@Test public void testDeleteTravel2() { Response response = new Response(); ResponseEntity<Response> re = new ResponseEntity<>(response, HttpStatus.OK); Mockito.when(restTemplate.exchange( "http: HttpMethod.DELETE, requestEntity, Response.class)).thenReturn(re); Response result = adminTravelServiceImpl.deleteTravel("K1024", headers); Assert.assertEquals(new Response<>(null, null, null), result); }