SEC-2684: Correct spelling of WithSecurityContextTestExecutionListener
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.security.test.context;
|
||||
|
||||
import org.springframework.security.test.context.support.WithSecurityContextTestExcecutionListener;
|
||||
import org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
@@ -38,5 +38,5 @@ import java.lang.annotation.*;
|
||||
DependencyInjectionTestExecutionListener.class,
|
||||
DirtiesContextTestExecutionListener.class,
|
||||
TransactionalTestExecutionListener.class,
|
||||
WithSecurityContextTestExcecutionListener.class})
|
||||
WithSecurityContextTestExecutionListener.class})
|
||||
public @interface DefaultSecurityTestExecutionListeners {}
|
||||
+1
-2
@@ -19,7 +19,6 @@ import javax.servlet.FilterChain;
|
||||
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.test.context.support.WithSecurityContextTestExcecutionListener;
|
||||
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors;
|
||||
import org.springframework.security.web.context.SecurityContextPersistenceFilter;
|
||||
import org.springframework.security.web.context.SecurityContextRepository;
|
||||
@@ -43,7 +42,7 @@ import org.springframework.util.Assert;
|
||||
* <ul>
|
||||
* <li>Before a test is executed, the {@link TestSecurityContextHolder} is
|
||||
* populated. Typically this is done using the
|
||||
* {@link WithSecurityContextTestExcecutionListener}</li>
|
||||
* {@link org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener}</li>
|
||||
* <li>The test is ran. When used with {@link MockMvc} it is typically used with
|
||||
* {@link SecurityMockMvcRequestPostProcessors#testSecurityContext()}. Which ensures
|
||||
* the {@link SecurityContext} from {@link TestSecurityContextHolder} is
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
/**
|
||||
* When used with {@link WithSecurityContextTestExcecutionListener} this annotation can be
|
||||
* When used with {@link WithSecurityContextTestExecutionListener} this annotation can be
|
||||
* added to a test method to emulate running with a mocked user. In order to work with {@link MockMvc} The
|
||||
* {@link SecurityContext} that is used will have the following properties:
|
||||
*
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
* @author Rob Winch
|
||||
* @since 4.0
|
||||
*/
|
||||
public class WithSecurityContextTestExcecutionListener extends
|
||||
public class WithSecurityContextTestExecutionListener extends
|
||||
AbstractTestExecutionListener {
|
||||
|
||||
/**
|
||||
+1
-1
@@ -31,7 +31,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
/**
|
||||
* When used with {@link WithSecurityContextTestExcecutionListener} this annotation can be
|
||||
* When used with {@link WithSecurityContextTestExecutionListener} this annotation can be
|
||||
* added to a test method to emulate running with a {@link UserDetails} returned
|
||||
* from the {@link UserDetailsService}. In order to work with {@link MockMvc}
|
||||
* The {@link SecurityContext} that is used will have the following properties:
|
||||
|
||||
+2
-2
@@ -37,11 +37,11 @@ public class WithSecurityContextTestExcecutionListenerTests {
|
||||
@Mock
|
||||
private TestContext testContext;
|
||||
|
||||
private WithSecurityContextTestExcecutionListener listener;
|
||||
private WithSecurityContextTestExecutionListener listener;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
listener = new WithSecurityContextTestExcecutionListener();
|
||||
listener = new WithSecurityContextTestExecutionListener();
|
||||
context = new AnnotationConfigApplicationContext(Config.class);
|
||||
}
|
||||
|
||||
|
||||
-6
@@ -35,14 +35,8 @@ import org.springframework.security.config.annotation.web.servlet.configuration.
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
|
||||
import org.springframework.security.test.context.support.WithUserDetails;
|
||||
import org.springframework.security.test.context.support.WithSecurityContextTestExcecutionListener;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
|
||||
import org.springframework.test.context.web.ServletTestExecutionListener;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
Reference in New Issue
Block a user