From 9683856956a62a74fd34993f2db05f6c8b9aad52 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 1ba39012bb..385358c210 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 @@ -30,7 +30,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; @@ -89,8 +88,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(); } @@ -124,8 +121,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(); } @@ -149,8 +144,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(); } @@ -185,8 +178,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(); } @@ -221,8 +212,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(); } @@ -253,8 +242,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(); } @@ -272,8 +259,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(); } @@ -302,8 +287,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(); } @@ -338,8 +321,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(); }