### Question:
TravelController { @GetMapping(value = "/routes/{tripId}") public HttpEntity getRouteByTripId(@PathVariable String tripId, @RequestHeader HttpHeaders headers) { TravelController.LOGGER.info("[Get Route By Trip ID] TripId: {}", tripId); return ok(travelService.getRouteByTripId(tripId, headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @GetMapping(value = "/train_types/{tripId}") HttpEntity getTrainTypeByTripId(@PathVariable String tripId,
                                           @RequestHeader HttpHeaders headers); @GetMapping(value = "/routes/{tripId}") HttpEntity getRouteByTripId(@PathVariable String tripId,
                                       @RequestHeader HttpHeaders headers); @PostMapping(value = "/trips/routes") HttpEntity getTripsByRouteId(@RequestBody ArrayList<String> routeIds,
                                        @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(value = "/trips") HttpEntity<?> createTrip(@RequestBody TravelInfo routeIds, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(value = "/trips/{tripId}") HttpEntity retrieve(@PathVariable String tripId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PutMapping(value = "/trips") HttpEntity updateTrip(@RequestBody TravelInfo info, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(value = "/trips/{tripId}") HttpEntity deleteTrip(@PathVariable String tripId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(value = "/trips/left") HttpEntity queryInfo(@RequestBody TripInfo info, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(value = "/trip_detail") HttpEntity getTripAllDetailInfo(@RequestBody TripAllDetailInfo gtdi, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(value = "/trips") HttpEntity queryAll(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(value = "/admin_trip") HttpEntity adminQueryAll(@RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testGetRouteByTripId() throws Exception { Mockito.when(service.getRouteByTripId(Mockito.anyString(), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/travelservice/routes/trip_id")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }