### Question:
UserController { @PostMapping("/login") public ResponseEntity<Response> getToken(@RequestBody BasicAuthDto dao , @RequestHeader HttpHeaders headers) { return ResponseEntity.ok(tokenService.getToken(dao, 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 testGetToken() throws Exception { BasicAuthDto dao = new BasicAuthDto(); Mockito.when(tokenService.getToken(Mockito.any(BasicAuthDto.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(dao); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/users/login").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }