### Question:
TicketInfoController { @PostMapping(value = "/ticketinfo") public HttpEntity queryForTravel(@RequestBody Travel info, @RequestHeader HttpHeaders headers) { return ok(service.queryForTravel(info, headers)); }  @GetMapping(path = "/welcome") String home(); @PostMapping(value = "/ticketinfo") HttpEntity queryForTravel(@RequestBody Travel info, @RequestHeader HttpHeaders headers); @GetMapping(value = "/ticketinfo/{name}") HttpEntity queryForStationId(@PathVariable String name, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testQueryForTravel() throws Exception { Travel info = new Travel(); Mockito.when(service.queryForTravel(Mockito.any(Travel.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(info); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/ticketinfoservice/ticketinfo").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }