### Question:
TrainFoodController { @CrossOrigin(origins = "*") @GetMapping("/trainfoods/{tripId}") public HttpEntity getTrainFoodOfTrip(@PathVariable String tripId, @RequestHeader HttpHeaders headers) { TrainFoodController.LOGGER.info("[Food Map Service][Get TrainFoods By TripId]"); return ok(foodMapService.listTrainFoodByTripId(tripId, headers)); }  @GetMapping(path = "/trainfoods/welcome") String home(); @CrossOrigin(origins = "*") @GetMapping("/trainfoods") HttpEntity getAllTrainFood(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping("/trainfoods/{tripId}") HttpEntity getTrainFoodOfTrip(@PathVariable String tripId, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testGetTrainFoodOfTrip() throws Exception { Mockito.when(foodMapService.listTrainFoodByTripId(Mockito.anyString(), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/foodmapservice/trainfoods/trip_id")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }