### Question:
TravelPlanController { @PostMapping(value="/travelPlan/transferResult" ) public HttpEntity getTransferResult(@RequestBody TransferTravelInfo info, @RequestHeader HttpHeaders headers) { TravelPlanController.LOGGER.info("[Search Transit]"); return ok(travelPlanService.getTransferSearch(info, headers)); }  @GetMapping(path = "/welcome" ) String home(); @PostMapping(value="/travelPlan/transferResult" ) HttpEntity getTransferResult(@RequestBody TransferTravelInfo info, @RequestHeader HttpHeaders headers); @PostMapping(value="/travelPlan/cheapest") HttpEntity getByCheapest(@RequestBody TripInfo queryInfo, @RequestHeader HttpHeaders headers); @PostMapping(value="/travelPlan/quickest") HttpEntity getByQuickest(@RequestBody TripInfo queryInfo, @RequestHeader HttpHeaders headers); @PostMapping(value="/travelPlan/minStation") HttpEntity getByMinStation(@RequestBody TripInfo queryInfo, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testGetTransferResult() throws Exception { TransferTravelInfo info = new TransferTravelInfo(); Mockito.when(travelPlanService.getTransferSearch(Mockito.any(TransferTravelInfo.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(info); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/travelplanservice/travelPlan/transferResult").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }