From c7ea8c6ac72ef0ced0a184936e90e14ceceb69f3 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Mon, 2 Oct 2023 17:47:37 -0600 Subject: [PATCH] Fix Formatting Issue gh-13654 --- .../OAuth2AuthorizationManagersTests.java | 12 ++++++------ .../OAuth2ReactiveAuthorizationManagersTests.java | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2AuthorizationManagersTests.java b/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2AuthorizationManagersTests.java index 487411ad18c..e8e39d77c48 100644 --- a/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2AuthorizationManagersTests.java +++ b/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2AuthorizationManagersTests.java @@ -37,16 +37,16 @@ public class OAuth2AuthorizationManagersTests { void hasScopeWhenInvalidScopeThenThrowIllegalArgument() { String scope = "SCOPE_invalid"; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> OAuth2AuthorizationManagers.hasScope(scope)) - .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); + .isThrownBy(() -> OAuth2AuthorizationManagers.hasScope(scope)) + .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); } @Test void hasAnyScopeWhenInvalidScopeThenThrowIllegalArgument() { String[] scopes = { "read", "write", "SCOPE_invalid" }; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> OAuth2AuthorizationManagers.hasAnyScope(scopes)) - .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); + .isThrownBy(() -> OAuth2AuthorizationManagers.hasAnyScope(scopes)) + .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); } @Test @@ -55,7 +55,7 @@ void hasScopeWhenValidScopeThenAuthorizationManager() { AuthorizationManager authorizationManager = OAuth2AuthorizationManagers.hasScope(scope); authorizationManager.verify(() -> hasScope(scope), new Object()); assertThatExceptionOfType(AccessDeniedException.class) - .isThrownBy(() -> authorizationManager.verify(() -> hasScope("wrong"), new Object())); + .isThrownBy(() -> authorizationManager.verify(() -> hasScope("wrong"), new Object())); } @Test @@ -66,7 +66,7 @@ void hasAnyScopeWhenValidScopesThenAuthorizationManager() { authorizationManager.verify(() -> hasScope(scope), new Object()); } assertThatExceptionOfType(AccessDeniedException.class) - .isThrownBy(() -> authorizationManager.verify(() -> hasScope("wrong"), new Object())); + .isThrownBy(() -> authorizationManager.verify(() -> hasScope("wrong"), new Object())); } Authentication hasScope(String scope) { diff --git a/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2ReactiveAuthorizationManagersTests.java b/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2ReactiveAuthorizationManagersTests.java index 8747b9c1ba2..e2dd11c3c04 100644 --- a/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2ReactiveAuthorizationManagersTests.java +++ b/oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/authorization/OAuth2ReactiveAuthorizationManagersTests.java @@ -37,16 +37,16 @@ public class OAuth2ReactiveAuthorizationManagersTests { void hasScopeWhenInvalidScopeThenThrowIllegalArgument() { String scope = "SCOPE_invalid"; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> OAuth2ReactiveAuthorizationManagers.hasScope(scope)) - .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); + .isThrownBy(() -> OAuth2ReactiveAuthorizationManagers.hasScope(scope)) + .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); } @Test void hasAnyScopeWhenInvalidScopeThenThrowIllegalArgument() { String[] scopes = { "read", "write", "SCOPE_invalid" }; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> OAuth2ReactiveAuthorizationManagers.hasAnyScope(scopes)) - .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); + .isThrownBy(() -> OAuth2ReactiveAuthorizationManagers.hasAnyScope(scopes)) + .withMessageContaining("SCOPE_invalid should not start with SCOPE_"); } @Test @@ -55,19 +55,19 @@ void hasScopeWhenValidScopeThenAuthorizationManager() { ReactiveAuthorizationManager authorizationManager = OAuth2ReactiveAuthorizationManagers.hasScope(scope); authorizationManager.verify(hasScope(scope), new Object()).block(); assertThatExceptionOfType(AccessDeniedException.class) - .isThrownBy(() -> authorizationManager.verify(hasScope("wrong"), new Object()).block()); + .isThrownBy(() -> authorizationManager.verify(hasScope("wrong"), new Object()).block()); } @Test void hasAnyScopeWhenValidScopesThenAuthorizationManager() { String[] scopes = { "read", "write" }; ReactiveAuthorizationManager authorizationManager = OAuth2ReactiveAuthorizationManagers - .hasAnyScope(scopes); + .hasAnyScope(scopes); for (String scope : scopes) { authorizationManager.verify(hasScope(scope), new Object()).block(); } assertThatExceptionOfType(AccessDeniedException.class) - .isThrownBy(() -> authorizationManager.verify(hasScope("wrong"), new Object()).block()); + .isThrownBy(() -> authorizationManager.verify(hasScope("wrong"), new Object()).block()); } Mono hasScope(String scope) {