### Question:
AuthController { @GetMapping(path = DISTRIBUTE_PATH) public void distributeInvalidate(HttpServletRequest request, HttpServletResponse response) { final String endpoint = "/auth/distribute/"; final String uri = request.getRequestURI(); final int index = uri.indexOf(endpoint); final String toInstanceId = uri.substring(index + endpoint.length()); final boolean distributed = authenticationService.distributeInvalidate(toInstanceId); response.setStatus(distributed ? SC_OK : SC_NO_CONTENT); }  @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 distributeInvalidate() throws Exception { when(authenticationService.distributeInvalidate("instance/1")).thenReturn(true); this.mockMvc.perform(get("/gateway/auth/distribute/instance/1")).andExpect(status().is(SC_OK)); when(authenticationService.distributeInvalidate("instance2")).thenReturn(false); this.mockMvc.perform(get("/gateway/auth/distribute/instance2")).andExpect(status().is(SC_NO_CONTENT)); }