diff --git a/web/src/main/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManager.java b/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java similarity index 86% rename from web/src/main/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManager.java rename to web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java index 705fb0efa2..b1c6378914 100644 --- a/web/src/main/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManager.java +++ b/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java @@ -40,13 +40,13 @@ import org.springframework.util.Assert; * @author Evgeniy Cheban * @since 5.5 */ -public final class DelegatingAuthorizationManager implements AuthorizationManager { +public final class RequestMatcherDelegatingAuthorizationManager implements AuthorizationManager { private final Log logger = LogFactory.getLog(getClass()); private final Map> mappings; - private DelegatingAuthorizationManager( + private RequestMatcherDelegatingAuthorizationManager( Map> mappings) { Assert.notEmpty(mappings, "mappings cannot be empty"); this.mappings = mappings; @@ -85,7 +85,7 @@ public final class DelegatingAuthorizationManager implements AuthorizationManage } /** - * Creates a builder for {@link DelegatingAuthorizationManager}. + * Creates a builder for {@link RequestMatcherDelegatingAuthorizationManager}. * @return the new {@link Builder} instance */ public static Builder builder() { @@ -93,7 +93,7 @@ public final class DelegatingAuthorizationManager implements AuthorizationManage } /** - * A builder for {@link DelegatingAuthorizationManager}. + * A builder for {@link RequestMatcherDelegatingAuthorizationManager}. */ public static final class Builder { @@ -113,11 +113,11 @@ public final class DelegatingAuthorizationManager implements AuthorizationManage } /** - * Creates a {@link DelegatingAuthorizationManager} instance. - * @return the {@link DelegatingAuthorizationManager} instance + * Creates a {@link RequestMatcherDelegatingAuthorizationManager} instance. + * @return the {@link RequestMatcherDelegatingAuthorizationManager} instance */ - public DelegatingAuthorizationManager build() { - return new DelegatingAuthorizationManager(this.mappings); + public RequestMatcherDelegatingAuthorizationManager build() { + return new RequestMatcherDelegatingAuthorizationManager(this.mappings); } } diff --git a/web/src/test/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManagerTests.java b/web/src/test/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManagerTests.java similarity index 81% rename from web/src/test/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManagerTests.java rename to web/src/test/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManagerTests.java index 04fa818b39..59e8c857d0 100644 --- a/web/src/test/java/org/springframework/security/web/access/intercept/DelegatingAuthorizationManagerTests.java +++ b/web/src/test/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManagerTests.java @@ -30,36 +30,38 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; /** - * Tests for {@link DelegatingAuthorizationManager}. + * Tests for {@link RequestMatcherDelegatingAuthorizationManager}. * * @author Evgeniy Cheban */ -public class DelegatingAuthorizationManagerTests { +public class RequestMatcherDelegatingAuthorizationManagerTests { @Test public void buildWhenMappingsEmptyThenException() { - assertThatIllegalArgumentException().isThrownBy(() -> DelegatingAuthorizationManager.builder().build()) + assertThatIllegalArgumentException() + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder().build()) .withMessage("mappings cannot be empty"); } @Test public void addWhenMatcherNullThenException() { assertThatIllegalArgumentException() - .isThrownBy(() -> DelegatingAuthorizationManager.builder() + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder() .add(null, (a, o) -> new AuthorizationDecision(true)).build()) .withMessage("matcher cannot be null"); } @Test public void addWhenManagerNullThenException() { - assertThatIllegalArgumentException().isThrownBy( - () -> DelegatingAuthorizationManager.builder().add(new MvcRequestMatcher(null, "/grant"), null).build()) + assertThatIllegalArgumentException() + .isThrownBy(() -> RequestMatcherDelegatingAuthorizationManager.builder() + .add(new MvcRequestMatcher(null, "/grant"), null).build()) .withMessage("manager cannot be null"); } @Test public void checkWhenMultipleMappingsConfiguredThenDelegatesMatchingManager() { - DelegatingAuthorizationManager manager = DelegatingAuthorizationManager.builder() + RequestMatcherDelegatingAuthorizationManager manager = RequestMatcherDelegatingAuthorizationManager.builder() .add(new MvcRequestMatcher(null, "/grant"), (a, o) -> new AuthorizationDecision(true)) .add(new MvcRequestMatcher(null, "/deny"), (a, o) -> new AuthorizationDecision(false)) .add(new MvcRequestMatcher(null, "/neutral"), (a, o) -> null).build();