Polish ExchangeMutatorWebFilter Support
Issue gh-4343
This commit is contained in:
+3
-2
@@ -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()
|
||||
|
||||
+4
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user