### Question:
AuthController { @DeleteMapping(path = INVALIDATE_PATH) public void invalidateJwtToken(HttpServletRequest request, HttpServletResponse response) { final String endpoint = "/auth/invalidate/"; final String uri = request.getRequestURI(); final int index = uri.indexOf(endpoint); final String jwtToken = uri.substring(index + endpoint.length()); final boolean invalidated = authenticationService.invalidateJwtToken(jwtToken, false); response.setStatus(invalidated ? SC_OK : SC_SERVICE_UNAVAILABLE); }  @DeleteMapping(path = INVALIDATE_PATH) void invalidateJwtToken(HttpServletRequest request, HttpServletResponse response); @GetMapping(path = DISTRIBUTE_PATH) void distributeInvalidate(HttpServletRequest request, HttpServletResponse response); @GetMapping(path = ALL_PUBLIC_KEYS_PATH) @ResponseBody JSONObject getAllPublicKeys(); @GetMapping(path = CURRENT_PUBLIC_KEYS_PATH) @ResponseBody JSONObject getCurrentPublicKeys(); static final String CONTROLLER_PATH; static final String INVALIDATE_PATH; static final String DISTRIBUTE_PATH; static final String PUBLIC_KEYS_PATH; static final String ALL_PUBLIC_KEYS_PATH; static final String CURRENT_PUBLIC_KEYS_PATH; }### Answer:
@Test void invalidateJwtToken() throws Exception { when(authenticationService.invalidateJwtToken("a/b", false)).thenReturn(Boolean.TRUE); this.mockMvc.perform(delete("/gateway/auth/invalidate/a/b")).andExpect(status().is(SC_OK)); when(authenticationService.invalidateJwtToken("abcde", false)).thenReturn(Boolean.TRUE); this.mockMvc.perform(delete("/gateway/auth/invalidate/abcde")).andExpect(status().is(SC_OK)); this.mockMvc.perform(delete("/gateway/auth/invalidate/xyz")).andExpect(status().is(SC_SERVICE_UNAVAILABLE)); verify(authenticationService, times(1)).invalidateJwtToken("abcde", false); verify(authenticationService, times(1)).invalidateJwtToken("a/b", false); }