### Question:
CancelController { @CrossOrigin(origins = "*") @GetMapping(path = "/cancel/refound/{orderId}") public HttpEntity calculate(@PathVariable String orderId, @RequestHeader HttpHeaders headers) { CancelController.LOGGER.info("[Cancel Order Service][Calculate Cancel Refund] OrderId: {}", orderId); return ok(cancelService.calculateRefund(orderId, headers)); }  @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 testCalculate() throws Exception { Mockito.when(cancelService.calculateRefund(Mockito.anyString(), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/cancelservice/cancel/refound/order_id")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }