### Question:
OrderController { @CrossOrigin(origins = "*") @PutMapping(path = "/order/admin") public HttpEntity updateOrder(@RequestBody Order order, @RequestHeader HttpHeaders headers) { return ok(orderService.updateOrder(order, headers)); }  @GetMapping(path = "/welcome") String home(); @PostMapping(value = "/order/tickets") HttpEntity getTicketListByDateAndTripId(@RequestBody Seat seatRequest, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/order") HttpEntity createNewOrder(@RequestBody Order createOrder, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/order/admin") HttpEntity addcreateNewOrder(@RequestBody Order order, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/order/query") HttpEntity queryOrders(@RequestBody OrderInfo qi,
                                  @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/order/refresh") HttpEntity queryOrdersForRefresh(@RequestBody OrderInfo qi,
                                            @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/{travelDate}/{trainNumber}") HttpEntity calculateSoldTicket(@PathVariable Date travelDate, @PathVariable String trainNumber,
                                          @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/price/{orderId}") HttpEntity getOrderPrice(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/orderPay/{orderId}") HttpEntity payOrder(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/{orderId}") HttpEntity getOrderById(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/status/{orderId}/{status}") HttpEntity modifyOrder(@PathVariable String orderId, @PathVariable int status, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order/security/{checkDate}/{accountId}") HttpEntity securityInfoCheck(@PathVariable Date checkDate, @PathVariable String accountId,
                                        @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PutMapping(path = "/order") HttpEntity saveOrderInfo(@RequestBody Order orderInfo,
                                    @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PutMapping(path = "/order/admin") HttpEntity updateOrder(@RequestBody Order order, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(path = "/order/{orderId}") HttpEntity deleteOrder(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/order") HttpEntity findAllOrder(@RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testUpdateOrder() throws Exception { Order order = new Order(); Mockito.when(orderService.updateOrder(Mockito.any(Order.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(order); String result = mockMvc.perform(MockMvcRequestBuilders.put("/api/v1/orderservice/order/admin").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }