Resolve compile errors -> WebTestClient methods removed

Fixes gh-4355
This commit is contained in:
Joe Grandja 2017-05-25 10:59:55 -04:00
parent 86d0fd77a7
commit 68368c87ca
2 changed files with 8 additions and 8 deletions

View File

@ -88,14 +88,14 @@ public class HttpSecurityTests {
WebTestClient client = buildClient();
EntityExchangeResult<byte[]> result = client
EntityExchangeResult<String> 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();

View File

@ -78,11 +78,11 @@ public class AuthenticationWebFilterTests {
.bindToWebFilters(filter)
.build();
EntityExchangeResult<byte[]> result = client.get()
EntityExchangeResult<String> 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<byte[]> result = client
EntityExchangeResult<String> 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<byte[]> result = client
EntityExchangeResult<String> 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);