### Question:
CancelController { @CrossOrigin(origins = "*") @GetMapping(path = "/cancel/{orderId}/{loginId}") public HttpEntity cancelTicket(@PathVariable String orderId, @PathVariable String loginId, @RequestHeader HttpHeaders headers) { CancelController.LOGGER.info("[Cancel Order Service][Cancel Ticket] info: {}", orderId); try { CancelController.LOGGER.info("[Cancel Order Service][Cancel Ticket] Verify Success"); return ok(cancelService.cancelOrder(orderId, loginId, headers)); } catch (Exception e) { LOGGER.error(e.getMessage()); return null; } }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/cancel/refound/{orderId}") HttpEntity calculate(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/cancel/{orderId}/{loginId}") HttpEntity cancelTicket(@PathVariable String orderId, @PathVariable String loginId,
                                   @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testCancelTicket() throws Exception { Mockito.when(cancelService.cancelOrder(Mockito.anyString(), Mockito.anyString(), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/cancelservice/cancel/order_id/login_id")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }