1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Mono.currentContext()->subscriberContext()

Fixing refactoring by Reactor
This commit is contained in:
Rob Winch
2017-09-01 17:12:39 -05:00
parent 72f139a824
commit d9bad2bc9d
4 changed files with 11 additions and 11 deletions
@@ -42,7 +42,7 @@ public class SecurityTestExecutionListenerTests {
@WithMockUser
@Test
public void reactorContextTestSecurityContextHolderExecutionListenerTestIsRegistered() {
Mono<String> name = Mono.currentContext()
Mono<String> name = Mono.subscriberContext()
.flatMap( context -> context.<Mono<Authentication>>get(Authentication.class))
.map(Principal::getName);
@@ -60,7 +60,7 @@ public class ReactorContextTestExecutionListenerTests {
public void beforeTestMethodWhenSecurityContextEmptyThenReactorContextNull() throws Exception {
this.listener.beforeTestMethod(this.testContext);
assertThat(Mono.currentContext().block().isEmpty()).isTrue();
assertThat(Mono.subscriberContext().block().isEmpty()).isTrue();
}
@Test
@@ -69,7 +69,7 @@ public class ReactorContextTestExecutionListenerTests {
this.listener.beforeTestMethod(this.testContext);
assertThat(Mono.currentContext().block().isEmpty()).isTrue();
assertThat(Mono.subscriberContext().block().isEmpty()).isTrue();
}
@@ -98,7 +98,7 @@ public class ReactorContextTestExecutionListenerTests {
this.listener.afterTestMethod(this.testContext);
assertThat(Mono.currentContext().block().isEmpty()).isTrue();
assertThat(Mono.subscriberContext().block().isEmpty()).isTrue();
}
@Test
@@ -110,7 +110,7 @@ public class ReactorContextTestExecutionListenerTests {
}
public void assertAuthentication(Authentication expected) {
Mono<Authentication> authentication = Mono.currentContext()
Mono<Authentication> authentication = Mono.subscriberContext()
.flatMap( context -> context.<Mono<Authentication>>get(Authentication.class));
StepVerifier.create(authentication)