From e5ceeb4e22d38a3fd69f00589c8e8fee2c366b0f Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Fri, 26 May 2017 07:17:32 -0400 Subject: [PATCH] Resolve compile errors -> MockServerExchangeMutator removed Fixes gh-4356 --- .../src/test/java/sample/HelloWebfluxApplicationTests.java | 7 ++++--- .../test/java/sample/HelloWebfluxFnApplicationTests.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/samples/javaconfig/hellowebflux/src/test/java/sample/HelloWebfluxApplicationTests.java b/samples/javaconfig/hellowebflux/src/test/java/sample/HelloWebfluxApplicationTests.java index 46670d8c05..aa12706da9 100644 --- a/samples/javaconfig/hellowebflux/src/test/java/sample/HelloWebfluxApplicationTests.java +++ b/samples/javaconfig/hellowebflux/src/test/java/sample/HelloWebfluxApplicationTests.java @@ -29,8 +29,8 @@ import org.springframework.security.web.server.header.ContentTypeOptionsHttpHead import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.ExchangeMutatorWebFilter; import org.springframework.test.web.reactive.server.ExchangeResult; -import org.springframework.test.web.reactive.server.MockServerExchangeMutator; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.ExchangeFilterFunction; @@ -161,10 +161,11 @@ public class HelloWebfluxApplicationTests { @Test public void mockSupport() throws Exception { - MockServerExchangeMutator exchangeMutator = new MockServerExchangeMutator(withUser()); + ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser()); WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build(); - exchangeMutator.filterClient(mockRest, withUser()) + mockRest + .filter(exchangeMutator.perClient(withUser())) .get() .uri("/principal") .exchange() diff --git a/samples/javaconfig/hellowebfluxfn/src/test/java/sample/HelloWebfluxFnApplicationTests.java b/samples/javaconfig/hellowebfluxfn/src/test/java/sample/HelloWebfluxFnApplicationTests.java index 98c1523e1a..32311009d3 100644 --- a/samples/javaconfig/hellowebfluxfn/src/test/java/sample/HelloWebfluxFnApplicationTests.java +++ b/samples/javaconfig/hellowebfluxfn/src/test/java/sample/HelloWebfluxFnApplicationTests.java @@ -29,8 +29,8 @@ import org.springframework.security.web.server.header.ContentTypeOptionsHttpHead import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.ExchangeMutatorWebFilter; import org.springframework.test.web.reactive.server.ExchangeResult; -import org.springframework.test.web.reactive.server.MockServerExchangeMutator; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.reactive.function.client.ExchangeFilterFunction; import org.springframework.web.reactive.function.server.RouterFunction; @@ -167,10 +167,11 @@ public class HelloWebfluxFnApplicationTests { @Test public void mockSupport() throws Exception { - MockServerExchangeMutator exchangeMutator = new MockServerExchangeMutator(withUser()); + ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser()); WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator).build(); - exchangeMutator.filterClient(mockRest, withUser()) + mockRest + .filter(exchangeMutator.perClient(withUser())) .get() .uri("/principal") .exchange()