### Question:
PreserveOtherController { @CrossOrigin(origins = "*") @PostMapping(value = "/preserveOther") public HttpEntity preserve(@RequestBody OrderTicketsInfo oti, @RequestHeader HttpHeaders headers) { PreserveOtherController.LOGGER.info("[Preserve Other Service][Preserve] Account order from {} -----> {} at {}", oti.getFrom(), oti.getTo(), oti.getDate()); return ok(preserveService.preserve(oti, headers)); }  @GetMapping(path = "/welcome") String home(); @CrossOrigin(origins = "*") @PostMapping(value = "/preserveOther") HttpEntity preserve(@RequestBody OrderTicketsInfo oti,
                               @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testPreserve() throws Exception { OrderTicketsInfo oti = new OrderTicketsInfo(); Mockito.when(preserveService.preserve(Mockito.any(OrderTicketsInfo.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(oti); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/preserveotherservice/preserveOther").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }