### Question:
DbTokenStore implements TokenStore { public void revokeAccessToken(String clientId, String username) { if(clientId != null) { dbAccessTokenRepository.deleteByClientIdAndUsername(clientId,username); } } DbTokenStore(DbAccessTokenRepository cbAccessTokenRepository, DbRefreshTokenRepository cbRefreshTokenRepository); @Override OAuth2Authentication readAuthentication(OAuth2AccessToken accessToken); @Override OAuth2Authentication readAuthentication(String token); @Override void storeAccessToken(OAuth2AccessToken accessToken, OAuth2Authentication authentication); @Override OAuth2AccessToken readAccessToken(String tokenValue); @Override void removeAccessToken(OAuth2AccessToken oAuth2AccessToken); @Override void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication); @Override OAuth2RefreshToken readRefreshToken(String tokenValue); @Override OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken refreshToken); @Override void removeRefreshToken(OAuth2RefreshToken refreshToken); @Override void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken); @Override OAuth2AccessToken getAccessToken(OAuth2Authentication authentication); @Override Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName); @Override Collection<OAuth2AccessToken> findTokensByClientId(String clientId); List<DbAccessToken> findTokensByUserName(String userName); void revokeAccessToken(String clientId, String username);  }### Answer:
@Test public void test_revokeAccessToken() { String username = "name"; String clientId = "client1"; managerToTest.revokeAccessToken(clientId,username); Mockito.verify(dbAccessTokenRepository).deleteByClientIdAndUsername(clientId,username); }
@Test public void test_revokeAccessToken_nullClientId() { String username = "name"; managerToTest.revokeAccessToken(null,username); Mockito.verify(dbAccessTokenRepository,Mockito.never()).deleteByClientIdAndUsername(null,username); }