### Question:
UserController { @GetMapping public ResponseEntity<Response> getAllUser(@RequestHeader HttpHeaders headers) { return ok(userService.getAllUsers(headers)); }  @GetMapping("/hello") String testHello(); @GetMapping ResponseEntity<Response> getAllUser(@RequestHeader HttpHeaders headers); @GetMapping("/{userName}") ResponseEntity<Response> getUserByUserName(@PathVariable String userName, @RequestHeader HttpHeaders headers); @GetMapping("/id/{userId}") ResponseEntity<Response> getUserByUserId(@PathVariable String userId, @RequestHeader HttpHeaders headers); @PostMapping("/register") ResponseEntity<Response> registerUser(@RequestBody UserDto userDto, @RequestHeader HttpHeaders headers); @DeleteMapping("/{userId}") ResponseEntity<Response> deleteUserById(@PathVariable String userId,
                                                   @RequestHeader HttpHeaders headers); @PutMapping ResponseEntity<Response> updateUser(@RequestBody UserDto user,
                                               @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testGetAllUser() throws Exception { Mockito.when(userService.getAllUsers(Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/userservice/users")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }