From d994ddc9b8a4f2ddaa54b550dc4d53b76e4b6419 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Tue, 31 May 2022 16:04:02 -0600 Subject: [PATCH] Polish InterceptUrlConfigTests Issue gh-11305 --- .../config/http/InterceptUrlConfigTests.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java b/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java index 41e8d20fbb..09e2a09557 100644 --- a/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java +++ b/config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java @@ -31,7 +31,6 @@ import org.springframework.mock.web.MockServletContext; import org.springframework.security.authorization.AuthorizationManager; import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContextExtension; -import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.RequestPostProcessor; import org.springframework.web.bind.annotation.PathVariable; @@ -90,8 +89,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/path").with(userCredentials())) .andExpect(status().isOk()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -125,8 +122,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(patch("/path").with(adminCredentials())) .andExpect(status().isOk()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -150,8 +145,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/path").with(adminCredentials())) .andExpect(status().isForbidden()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -186,8 +179,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/path").with(userCredentials())) .andExpect(status().isForbidden()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -222,8 +213,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/PATH/user/path").with(userCredentials())) .andExpect(status().isForbidden()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -254,8 +243,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/path/2/path").with(userCredentials())) .andExpect(status().isForbidden()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -273,8 +260,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/path")).andExpect(status().isUnauthorized()); this.mvc.perform(get("/path.html")).andExpect(status().isUnauthorized()); this.mvc.perform(get("/path/")).andExpect(status().isUnauthorized()); - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -303,8 +288,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/PATH/user/path").with(userCredentials())) .andExpect(status().isForbidden()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); } @@ -339,8 +322,6 @@ public class InterceptUrlConfigTests { this.mvc.perform(get("/spring/path/").servletPath("/spring")) .andExpect(status().isUnauthorized()); // @formatter:on - assertThat(this.spring.getContext().getBeanNamesForType(FilterInvocationSecurityMetadataSource.class)) - .isEmpty(); assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull(); }