mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-03 20:09:18 +00:00
Fix imports
This commit is contained in:
parent
97ec5c921e
commit
2ee8f27997
@ -17,10 +17,11 @@
|
||||
package org.springframework.security.oauth2.core;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.security.authorization.AuthorityAuthorizationManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
/**
|
||||
* Tests for {@link OAuth2AuthorizationManagers}
|
||||
@ -32,15 +33,17 @@ public class OAuth2AuthorizationManagersTests {
|
||||
@Test
|
||||
void hasScope_withInvalidScope_shouldThrowIllegalArgumentException() {
|
||||
String scope = "SCOPE_invalid";
|
||||
assertThatThrownBy(() -> OAuth2AuthorizationManagers.hasScope(scope))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> OAuth2AuthorizationManagers.hasScope(scope))
|
||||
.withMessage("Scope 'SCOPE_invalid' start with 'SCOPE_' prefix.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void hasScopes_withInvalidScope_shouldThrowIllegalArgumentException() {
|
||||
String[] scopes = { "read", "write", "SCOPE_invalid" };
|
||||
assertThatThrownBy(() -> OAuth2AuthorizationManagers.hasAnyScope(scopes))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatExceptionOfType(IllegalArgumentException.class)
|
||||
.isThrownBy(() -> OAuth2AuthorizationManagers.hasAnyScope(scopes))
|
||||
.withMessage("Scope 'SCOPE_invalid' start with 'SCOPE_' prefix.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user