### Question:
RevokeTokenService { public void revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId) { if (TokenTypeHint.refresh_token.equals(tokenTypeHint)) { revokeRefreshToken(token, clientId); } else { revokeAccessToken(token, clientId); } }  void revokeToken(TokenTypeHint tokenTypeHint, String token, String clientId);  }### Answer:
@Test public void revokeToken_shouldRevokeRefreshToken() { String token = "refreshToken"; OAuth2RefreshToken refreshToken = () -> token; doReturn(refreshToken).when(tokenStore).readRefreshToken(token); doReturn(this.authentication).when(tokenStore).readAuthenticationForRefreshToken(refreshToken); revokeTokenService.revokeToken(TokenTypeHint.refresh_token, token, this.clientId); verify(tokenStore).readRefreshToken(token); verify(tokenStore).readAuthenticationForRefreshToken(refreshToken); verify(tokenStore).removeAccessTokenUsingRefreshToken(refreshToken); verify(tokenStore).removeRefreshToken(refreshToken); }
@Test public void revokeToken_shouldRevokeAccessToken() { String token = "accessToken"; doReturn(this.authentication).when(tokenStore).readAuthentication(token); revokeTokenService.revokeToken(TokenTypeHint.access_token, token, clientId); verify(tokenStore).readAuthentication(token); verify(tokenServices).revokeToken(token); }