### Question:
UserController { @GetMapping public ResponseEntity<List<User>> getAllUser(@RequestHeader HttpHeaders headers) { return ResponseEntity.ok().body(userService.getAllUser(headers)); }  @GetMapping("/hello") Object getHello(); @PostMapping("/login") ResponseEntity<Response> getToken(@RequestBody BasicAuthDto dao , @RequestHeader HttpHeaders headers); @GetMapping ResponseEntity<List<User>> getAllUser(@RequestHeader HttpHeaders headers); @DeleteMapping("/{userId}") ResponseEntity<Response> deleteUserById(@PathVariable String userId, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testGetAllUser() throws Exception { List<User> userList = new ArrayList<>(); Mockito.when(userService.getAllUser(Mockito.any(HttpHeaders.class))).thenReturn(userList); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/users")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(userList, JSONObject.parseObject(result, List.class)); }