Skip to content

Commit

Permalink
Add verification for revokeAccessTokens method invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
SujanSanjula96 committed Jan 3, 2025
1 parent c8efd77 commit 1ced028
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockStatic;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
Expand Down Expand Up @@ -285,6 +287,7 @@ public void testRevokeTokensForApplicationAudienceRoles() throws Exception {
any(AuthenticatedUser.class), nullable(String.class), anyBoolean())).thenReturn(accessTokens);

boolean result = OAuthUtil.revokeTokens(username, userStoreManager, roleId);
verify(mockAccessTokenDAO, times(1)).revokeAccessTokens(any(), anyBoolean());
assertTrue(result, "Token revocation failed.");
}

Expand Down

0 comments on commit 1ced028

Please sign in to comment.