Browse Source

Polish ReactorContextTestExecutionListenerTests

Necessary for preparing for the changes that will be made. The Context
should not necessarily be empty, but it should not contain the SecurityContext

Issue gh-4718
pull/4631/merge
Rob Winch 8 years ago
parent
commit
9363e2ba41
  1. 13
      test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java

13
test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java

@ -60,7 +60,11 @@ public class ReactorContextTestExecutionListenerTests {
public void beforeTestMethodWhenSecurityContextEmptyThenReactorContextNull() throws Exception { public void beforeTestMethodWhenSecurityContextEmptyThenReactorContextNull() throws Exception {
this.listener.beforeTestMethod(this.testContext); this.listener.beforeTestMethod(this.testContext);
assertThat(Mono.subscriberContext().block().isEmpty()).isTrue(); Mono<?> result = ReactiveSecurityContextHolder
.getContext();
StepVerifier.create(result)
.verifyComplete();
} }
@Test @Test
@ -69,9 +73,12 @@ public class ReactorContextTestExecutionListenerTests {
this.listener.beforeTestMethod(this.testContext); this.listener.beforeTestMethod(this.testContext);
assertThat(Mono.subscriberContext().block().isEmpty()).isTrue(); Mono<?> result = ReactiveSecurityContextHolder
} .getContext();
StepVerifier.create(result)
.verifyComplete();
}
@Test @Test
public void beforeTestMethodWhenAuthenticationThenReactorContextHasAuthentication() throws Exception { public void beforeTestMethodWhenAuthenticationThenReactorContextHasAuthentication() throws Exception {

Loading…
Cancel
Save