### Question:
TicketInfoController { @GetMapping(value = "/ticketinfo/{name}") public HttpEntity queryForStationId(@PathVariable String name, @RequestHeader HttpHeaders headers) { return ok(service.queryForStationId(name, 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 testQueryForStationId() throws Exception { Mockito.when(service.queryForStationId(Mockito.anyString(), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/ticketinfoservice/ticketinfo/name")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }