### Question:
AdminOrderController { @PostMapping(value = "/adminorder") public HttpEntity addOrder(@RequestBody Order request, @RequestHeader HttpHeaders headers) { return ok(adminOrderService.addOrder(request, headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/adminorder") HttpEntity getAllOrders(@RequestHeader HttpHeaders headers); @PostMapping(value = "/adminorder") HttpEntity addOrder(@RequestBody Order request, @RequestHeader HttpHeaders headers); @PutMapping(value = "/adminorder") HttpEntity updateOrder(@RequestBody Order request, @RequestHeader HttpHeaders headers); @DeleteMapping(value = "/adminorder/{orderId}/{trainNumber}") HttpEntity deleteOrder(@PathVariable String orderId, @PathVariable String trainNumber, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testAddOrder() throws Exception { Order order = new Order(null, null, null, null, null, null, 0, null, "G", 0, 0, null, null, null, 0, null); Mockito.when(adminOrderService.addOrder(Mockito.any(Order.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(order); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/adminorderservice/adminorder").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }