### Question:
AdminTravelController { @PutMapping(value = "/admintravel") public HttpEntity updateTravel(@RequestBody TravelInfo request, @RequestHeader HttpHeaders headers) { return ok(adminTravelService.updateTravel(request, headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/admintravel") HttpEntity getAllTravels(@RequestHeader HttpHeaders headers); @PostMapping(value = "/admintravel") HttpEntity addTravel(@RequestBody TravelInfo request, @RequestHeader HttpHeaders headers); @PutMapping(value = "/admintravel") HttpEntity updateTravel(@RequestBody TravelInfo request, @RequestHeader HttpHeaders headers); @DeleteMapping(value = "/admintravel/{tripId}") HttpEntity deleteTravel(@PathVariable String tripId, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testUpdateTravel() throws Exception { TravelInfo request = new TravelInfo(); Mockito.when(adminTravelService.updateTravel(Mockito.any(TravelInfo.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(request); String result = mockMvc.perform(MockMvcRequestBuilders.put("/api/v1/admintravelservice/admintravel").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }