From 68368c87ca8275ffa4ccd3817f5c2e4448f926cb Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Thu, 25 May 2017 10:59:55 -0400 Subject: [PATCH] Resolve compile errors -> WebTestClient methods removed Fixes gh-4355 --- .../config/web/server/HttpSecurityTests.java | 4 ++-- .../authentication/AuthenticationWebFilterTests.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/src/test/java/org/springframework/security/config/web/server/HttpSecurityTests.java b/config/src/test/java/org/springframework/security/config/web/server/HttpSecurityTests.java index 41800c820b..03ef0b4e00 100644 --- a/config/src/test/java/org/springframework/security/config/web/server/HttpSecurityTests.java +++ b/config/src/test/java/org/springframework/security/config/web/server/HttpSecurityTests.java @@ -88,14 +88,14 @@ public class HttpSecurityTests { WebTestClient client = buildClient(); - EntityExchangeResult result = client + EntityExchangeResult result = client .filter(basicAuthentication("rob", "rob")) .get() .uri("/") .exchange() .expectStatus().isOk() .expectHeader().valueMatches(HttpHeaders.CACHE_CONTROL, ".+") - .expectBody().consumeAsStringWith( b-> assertThat(b).isEqualTo("ok")) + .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); assertThat(result.getResponseCookies().getFirst("SESSION")).isNotNull(); diff --git a/webflux/src/test/java/org/springframework/security/web/server/authentication/AuthenticationWebFilterTests.java b/webflux/src/test/java/org/springframework/security/web/server/authentication/AuthenticationWebFilterTests.java index 8b2c8b5a8e..812b2fbae4 100644 --- a/webflux/src/test/java/org/springframework/security/web/server/authentication/AuthenticationWebFilterTests.java +++ b/webflux/src/test/java/org/springframework/security/web/server/authentication/AuthenticationWebFilterTests.java @@ -78,11 +78,11 @@ public class AuthenticationWebFilterTests { .bindToWebFilters(filter) .build(); - EntityExchangeResult result = client.get() + EntityExchangeResult result = client.get() .uri("/") .exchange() .expectStatus().isOk() - .expectBody().consumeAsStringWith(b -> assertThat(b).isEqualTo("ok")) + .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); verifyZeroInteractions(authenticationManager); @@ -98,13 +98,13 @@ public class AuthenticationWebFilterTests { .bindToWebFilters(filter) .build(); - EntityExchangeResult result = client + EntityExchangeResult result = client .filter(basicAuthentication("test","this")) .get() .uri("/") .exchange() .expectStatus().isOk() - .expectBody().consumeAsStringWith(b -> assertThat(b).isEqualTo("ok")) + .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); assertThat(result.getResponseCookies()).isEmpty(); @@ -139,12 +139,12 @@ public class AuthenticationWebFilterTests { .bindToWebFilters(filter) .build(); - EntityExchangeResult result = client + EntityExchangeResult result = client .get() .uri("/") .exchange() .expectStatus().isOk() - .expectBody().consumeAsStringWith(b -> assertThat(b).isEqualTo("ok")) + .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); verifyZeroInteractions(authenticationManager, successHandler, entryPoint);