mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-30 22:28:46 +00:00 
			
		
		
		
	Add cross references to ReactorContextTestExecutionListener
Fixes: gh-5418
This commit is contained in:
		
							parent
							
								
									bb11a81857
								
							
						
					
					
						commit
						1137f3b46d
					
				| @ -44,6 +44,7 @@ This is a basic example of how to setup Spring Security Test. The highlights are | |||||||
| 
 | 
 | ||||||
| NOTE: Spring Security hooks into Spring Test support using the `WithSecurityContextTestExecutionListener` which will ensure our tests are ran with the correct user. | NOTE: Spring Security hooks into Spring Test support using the `WithSecurityContextTestExecutionListener` which will ensure our tests are ran with the correct user. | ||||||
| It does this by populating the `SecurityContextHolder` prior to running our tests. | It does this by populating the `SecurityContextHolder` prior to running our tests. | ||||||
|  | If you are using reactive method security, you will also need `ReactorContextTestExecutionListener` which populates `ReactiveSecurityContextHolder`. | ||||||
| After the test is done, it will clear out the `SecurityContextHolder`. | After the test is done, it will clear out the `SecurityContextHolder`. | ||||||
| If you only need Spring Security related support, you can replace `@ContextConfiguration` with `@SecurityTestExecutionListeners`. | If you only need Spring Security related support, you can replace `@ContextConfiguration` with `@SecurityTestExecutionListeners`. | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -36,6 +36,8 @@ import org.springframework.test.context.TestExecutionListeners; | |||||||
|  * |  * | ||||||
|  * @author Rob Winch |  * @author Rob Winch | ||||||
|  * @since 4.0.2 |  * @since 4.0.2 | ||||||
|  |  * @see WithSecurityContextTestExecutionListener | ||||||
|  |  * @see ReactorContextTestExecutionListener | ||||||
|  */ |  */ | ||||||
| @Documented | @Documented | ||||||
| @Inherited | @Inherited | ||||||
|  | |||||||
| @ -37,6 +37,8 @@ import reactor.util.context.Context; | |||||||
|  * |  * | ||||||
|  * @author Rob Winch |  * @author Rob Winch | ||||||
|  * @since 5.0 |  * @since 5.0 | ||||||
|  |  * @see WithSecurityContextTestExecutionListener | ||||||
|  |  * @see org.springframework.security.test.context.annotation.SecurityTestExecutionListeners | ||||||
|  */ |  */ | ||||||
| public class ReactorContextTestExecutionListener | public class ReactorContextTestExecutionListener | ||||||
| 	extends DelegatingTestExecutionListener { | 	extends DelegatingTestExecutionListener { | ||||||
|  | |||||||
| @ -43,6 +43,8 @@ import org.springframework.test.web.servlet.MockMvc; | |||||||
|  * @author Rob Winch |  * @author Rob Winch | ||||||
|  * @author Eddú Meléndez |  * @author Eddú Meléndez | ||||||
|  * @since 4.0 |  * @since 4.0 | ||||||
|  |  * @see ReactorContextTestExecutionListener | ||||||
|  |  * @see org.springframework.security.test.context.annotation.SecurityTestExecutionListeners | ||||||
|  */ |  */ | ||||||
| public class WithSecurityContextTestExecutionListener | public class WithSecurityContextTestExecutionListener | ||||||
| 		extends AbstractTestExecutionListener { | 		extends AbstractTestExecutionListener { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user