1
0
mirror of synced 2026-08-03 16:56:56 +00:00

Polish ExchangeMutatorWebFilter Support

Issue gh-4343
This commit is contained in:
Rob Winch
2017-05-30 22:44:56 -05:00
parent 6aa7f05579
commit 915de03f42
3 changed files with 19 additions and 20 deletions
@@ -161,16 +161,17 @@ public class HelloWebfluxApplicationTests {
@Test
public void mockSupport() throws Exception {
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser());
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter();
WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
mockRest
.filter(exchangeMutator.perClient(withUser()))
.get()
.uri("/principal")
.exchange()
.expectStatus().isOk();
this.rest
mockRest
.get()
.uri("/principal")
.exchange()
@@ -167,16 +167,17 @@ public class HelloWebfluxFnApplicationTests {
@Test
public void mockSupport() throws Exception {
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser());
WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator).build();
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter();
WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator, springSecurityFilterChain).build();
mockRest
.filter(exchangeMutator.perClient(withUser()))
.get()
.uri("/principal")
.exchange()
.expectStatus().isOk();
this.rest
mockRest
.get()
.uri("/principal")
.exchange()