### Question:
AdminUserController { @PostMapping public HttpEntity addUser(@RequestBody UserDto userDto, @RequestHeader HttpHeaders headers) { return ok(adminUserService.addUser(userDto, headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping HttpEntity getAllUsers(@RequestHeader HttpHeaders headers); @PutMapping HttpEntity updateUser(@RequestBody UserDto userDto, @RequestHeader HttpHeaders headers); @PostMapping HttpEntity addUser(@RequestBody UserDto userDto, @RequestHeader HttpHeaders headers); @DeleteMapping(value = "/{userId}") HttpEntity deleteUser(@PathVariable String userId, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testAddUser() throws Exception { UserDto userDto = new UserDto(); Mockito.when(adminUserService.addUser(Mockito.any(UserDto.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(userDto); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/adminuserservice/users").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }