|
@@ -55,6 +55,7 @@ import org.springframework.util.MultiValueMap;
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
import static org.mockito.ArgumentMatchers.eq;
|
|
|
+import static org.mockito.ArgumentMatchers.isNull;
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
import static org.mockito.Mockito.reset;
|
|
|
import static org.mockito.Mockito.verify;
|
|
@@ -102,7 +103,7 @@ public class OAuth2TokenRevocationTests {
|
|
|
OAuth2Authorization authorization = TestOAuth2Authorizations.authorization(registeredClient).build();
|
|
|
OAuth2RefreshToken token = authorization.getTokens().getRefreshToken();
|
|
|
TokenType tokenType = TokenType.REFRESH_TOKEN;
|
|
|
- when(authorizationService.findByToken(eq(token.getTokenValue()), eq(tokenType))).thenReturn(authorization);
|
|
|
+ when(authorizationService.findByToken(eq(token.getTokenValue()), isNull())).thenReturn(authorization);
|
|
|
|
|
|
this.mvc.perform(MockMvcRequestBuilders.post(OAuth2TokenRevocationEndpointFilter.DEFAULT_TOKEN_REVOCATION_ENDPOINT_URI)
|
|
|
.params(getTokenRevocationRequestParameters(token, tokenType))
|
|
@@ -111,7 +112,7 @@ public class OAuth2TokenRevocationTests {
|
|
|
.andExpect(status().isOk());
|
|
|
|
|
|
verify(registeredClientRepository).findByClientId(eq(registeredClient.getClientId()));
|
|
|
- verify(authorizationService).findByToken(eq(token.getTokenValue()), eq(tokenType));
|
|
|
+ verify(authorizationService).findByToken(eq(token.getTokenValue()), isNull());
|
|
|
|
|
|
ArgumentCaptor<OAuth2Authorization> authorizationCaptor = ArgumentCaptor.forClass(OAuth2Authorization.class);
|
|
|
verify(authorizationService).save(authorizationCaptor.capture());
|
|
@@ -134,7 +135,7 @@ public class OAuth2TokenRevocationTests {
|
|
|
OAuth2Authorization authorization = TestOAuth2Authorizations.authorization(registeredClient).build();
|
|
|
OAuth2AccessToken token = authorization.getTokens().getAccessToken();
|
|
|
TokenType tokenType = TokenType.ACCESS_TOKEN;
|
|
|
- when(authorizationService.findByToken(eq(token.getTokenValue()), eq(tokenType))).thenReturn(authorization);
|
|
|
+ when(authorizationService.findByToken(eq(token.getTokenValue()), isNull())).thenReturn(authorization);
|
|
|
|
|
|
this.mvc.perform(MockMvcRequestBuilders.post(OAuth2TokenRevocationEndpointFilter.DEFAULT_TOKEN_REVOCATION_ENDPOINT_URI)
|
|
|
.params(getTokenRevocationRequestParameters(token, tokenType))
|
|
@@ -143,7 +144,7 @@ public class OAuth2TokenRevocationTests {
|
|
|
.andExpect(status().isOk());
|
|
|
|
|
|
verify(registeredClientRepository).findByClientId(eq(registeredClient.getClientId()));
|
|
|
- verify(authorizationService).findByToken(eq(token.getTokenValue()), eq(tokenType));
|
|
|
+ verify(authorizationService).findByToken(eq(token.getTokenValue()), isNull());
|
|
|
|
|
|
ArgumentCaptor<OAuth2Authorization> authorizationCaptor = ArgumentCaptor.forClass(OAuth2Authorization.class);
|
|
|
verify(authorizationService).save(authorizationCaptor.capture());
|