File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
core/src/test/java/org/springframework/security/authorization Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2121
2222import org .junit .jupiter .api .Test ;
2323
24+ import org .springframework .security .access .AccessDeniedException ;
2425import org .springframework .security .access .hierarchicalroles .NullRoleHierarchy ;
2526import org .springframework .security .access .hierarchicalroles .RoleHierarchy ;
2627import org .springframework .security .access .hierarchicalroles .RoleHierarchyImpl ;
@@ -273,21 +274,21 @@ void hasAnyRoleWhenEmptyRolePrefixThenNoException() {
273274 }
274275
275276 @ Test
276- void hasScopes_withInvalidScope_shouldThrowIllegalArgumentException () {
277+ void hasAnyScopeWhenInvalidScopeThenThrowIllegalArgument () {
277278 String [] scopes = { "read" , "write" , "SCOPE_invalid" };
278279 assertThatExceptionOfType (IllegalArgumentException .class )
279280 .isThrownBy (() -> AuthorityAuthorizationManager .hasAnyScope (scopes ))
280- .withMessage ( "Scope ' SCOPE_invalid' start with ' SCOPE_' prefix. " );
281+ .withMessageContaining ( " SCOPE_invalid should not start with SCOPE_" );
281282 }
282283
283284 @ Test
284- void hasScope_withValidScope_shouldPass () {
285+ void hasScopeWhenValidScope () {
285286 String scope = "read" ;
286287 assertThat (AuthorityAuthorizationManager .hasScope (scope )).isNotNull ();
287288 }
288289
289290 @ Test
290- void hasScope_withValidScopes_shouldPass () {
291+ void hasAnyScopeWhenValidScopes () {
291292 String [] scopes = { "read" , "write" };
292293 assertThat (AuthorityAuthorizationManager .hasAnyScope (scopes )).isNotNull ();
293294 }
You can’t perform that action at this time.
0 commit comments