SEC-2788: Add @Configuration as meta annotation to @Enable* annotations
This commit is contained in:
-1
@@ -67,7 +67,6 @@ public class WithMockUserTests {
|
||||
assertThat(message).contains("admin").contains("ROLE_USER").contains("ROLE_ADMIN");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@ComponentScan(basePackageClasses = HelloMessageService.class)
|
||||
static class Config {
|
||||
|
||||
-1
@@ -67,7 +67,6 @@ public class WithUserDetailsTests {
|
||||
assertThat(getPrincipal()).isInstanceOf(CustomUserDetails.class);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@ComponentScan(basePackageClasses = HelloMessageService.class)
|
||||
static class Config {
|
||||
|
||||
+1
-2
@@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@ContextConfiguration(classes=SecurityMockMvcRequestPostProcessorsAuthenticationStatelessTests.Config.class)
|
||||
@WebAppConfiguration
|
||||
public class SecurityMockMvcRequestPostProcessorsAuthenticationStatelessTests {
|
||||
|
||||
@@ -69,7 +69,6 @@ public class SecurityMockMvcRequestPostProcessorsAuthenticationStatelessTests {
|
||||
.andExpect(status().is2xxSuccessful());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
+1
-2
@@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@ContextConfiguration(classes = SecurityMockMvcRequestPostProcessorsTestSecurityContextStatelessTests.Config.class)
|
||||
@WebAppConfiguration
|
||||
public class SecurityMockMvcRequestPostProcessorsTestSecurityContextStatelessTests {
|
||||
|
||||
@@ -73,7 +73,6 @@ public class SecurityMockMvcRequestPostProcessorsTestSecurityContextStatelessTes
|
||||
.andExpect(status().is2xxSuccessful());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
+1
-2
@@ -23,7 +23,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@ContextConfiguration(classes = SecurityMockMvcResultMatchersTests.Config.class)
|
||||
@WebAppConfiguration
|
||||
public class SecurityMockMvcResultMatchersTests {
|
||||
@Autowired
|
||||
@@ -52,7 +52,6 @@ public class SecurityMockMvcResultMatchersTests {
|
||||
.andExpect(authenticated().withRoles("USER"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -77,7 +77,6 @@ public class CsrfShowcaseTests {
|
||||
.andExpect(status().isForbidden());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -75,7 +75,6 @@ public class CustomCsrfShowcaseTests {
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -69,7 +69,6 @@ public class DefaultCsrfShowcaseTests {
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -89,7 +89,6 @@ public class AuthenticationTests {
|
||||
.andExpect(unauthenticated());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -90,7 +90,6 @@ public class CustomConfigAuthenticationTests {
|
||||
.andExpect(unauthenticated());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -81,7 +81,6 @@ public class CustomLoginRequestBuilderAuthenticationTests {
|
||||
.passwordParam("pass");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -82,7 +82,6 @@ public class DefaultfSecurityRequestsTests {
|
||||
.andExpect(authenticated().withUsername("user"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -106,7 +106,6 @@ public class SecurityRequestsTests {
|
||||
.andExpect(authenticated().withAuthentication(authentication));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -78,7 +78,6 @@ public class WithUserAuthenticationTests {
|
||||
.andExpect(authenticated().withUsername("user").withRoles("ADMIN"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -77,7 +77,6 @@ public class WithUserClassLevelAuthenticationTests {
|
||||
.andExpect(authenticated().withUsername("user").withRoles("ADMIN"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -80,7 +80,6 @@ public class WithUserDetailsAuthenticationTests {
|
||||
.andExpect(authenticated().withUsername("admin").withRoles("ADMIN","USER"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-1
@@ -79,7 +79,6 @@ public class WithUserDetailsClassLevelAuthenticationTests {
|
||||
.andExpect(authenticated().withUsername("admin").withRoles("ADMIN","USER"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvcSecurity
|
||||
@EnableWebMvc
|
||||
static class Config extends WebSecurityConfigurerAdapter {
|
||||
|
||||
-2
@@ -123,7 +123,6 @@ public class WebTestUtilsTests {
|
||||
@Configuration
|
||||
static class Config {}
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
static class SecurityNoCsrfConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@@ -133,7 +132,6 @@ public class WebTestUtilsTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
static class CustomSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
static CsrfTokenRepository CSRF_REPO;
|
||||
|
||||
Reference in New Issue
Block a user