mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 23:02:15 +00:00
Resolve compile errors -> MockServerExchangeMutator removed
Fixes gh-4356
This commit is contained in:
parent
68368c87ca
commit
e5ceeb4e22
@ -29,8 +29,8 @@ import org.springframework.security.web.server.header.ContentTypeOptionsHttpHead
|
|||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
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.ExchangeResult;
|
||||||
import org.springframework.test.web.reactive.server.MockServerExchangeMutator;
|
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
||||||
|
|
||||||
@ -161,10 +161,11 @@ public class HelloWebfluxApplicationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mockSupport() throws Exception {
|
public void mockSupport() throws Exception {
|
||||||
MockServerExchangeMutator exchangeMutator = new MockServerExchangeMutator(withUser());
|
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser());
|
||||||
WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
|
WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
|
||||||
|
|
||||||
exchangeMutator.filterClient(mockRest, withUser())
|
mockRest
|
||||||
|
.filter(exchangeMutator.perClient(withUser()))
|
||||||
.get()
|
.get()
|
||||||
.uri("/principal")
|
.uri("/principal")
|
||||||
.exchange()
|
.exchange()
|
||||||
|
@ -29,8 +29,8 @@ import org.springframework.security.web.server.header.ContentTypeOptionsHttpHead
|
|||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
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.ExchangeResult;
|
||||||
import org.springframework.test.web.reactive.server.MockServerExchangeMutator;
|
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
||||||
import org.springframework.web.reactive.function.server.RouterFunction;
|
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||||
@ -167,10 +167,11 @@ public class HelloWebfluxFnApplicationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mockSupport() throws Exception {
|
public void mockSupport() throws Exception {
|
||||||
MockServerExchangeMutator exchangeMutator = new MockServerExchangeMutator(withUser());
|
ExchangeMutatorWebFilter exchangeMutator = new ExchangeMutatorWebFilter(withUser());
|
||||||
WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator).build();
|
WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator).build();
|
||||||
|
|
||||||
exchangeMutator.filterClient(mockRest, withUser())
|
mockRest
|
||||||
|
.filter(exchangeMutator.perClient(withUser()))
|
||||||
.get()
|
.get()
|
||||||
.uri("/principal")
|
.uri("/principal")
|
||||||
.exchange()
|
.exchange()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user