Browse Source

Fix WebClientTest calls

Update calls to WebClientTest following upstream changes.
pull/95/merge
Phillip Webb 9 years ago
parent
commit
700f0ea93c
  1. 2
      spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java
  2. 4
      spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAllControllersIntegrationTests.java
  3. 2
      spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestOneControllerIntegrationTests.java
  4. 4
      spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java
  5. 4
      spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java

2
spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java

@ -41,7 +41,7 @@ public class SampleWebFluxApplicationTests { @@ -41,7 +41,7 @@ public class SampleWebFluxApplicationTests {
@Test
public void testWelcome() throws Exception {
this.webClient.get().uri("/").accept(MediaType.TEXT_PLAIN).exchange()
.expectBody(String.class).value().isEqualTo("Hello World");
.expectBody(String.class).isEqualTo("Hello World");
}
}

4
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAllControllersIntegrationTests.java

@ -39,13 +39,13 @@ public class WebFluxTestAllControllersIntegrationTests { @@ -39,13 +39,13 @@ public class WebFluxTestAllControllersIntegrationTests {
@Test
public void shouldFindController1() {
this.webClient.get().uri("/one").exchange().expectStatus().isOk()
.expectBody(String.class).value().isEqualTo("one");
.expectBody(String.class).isEqualTo("one");
}
@Test
public void shouldFindController2() {
this.webClient.get().uri("/two").exchange().expectStatus().isOk()
.expectBody(String.class).value().isEqualTo("two");
.expectBody(String.class).isEqualTo("two");
}
}

2
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestOneControllerIntegrationTests.java

@ -39,7 +39,7 @@ public class WebFluxTestOneControllerIntegrationTests { @@ -39,7 +39,7 @@ public class WebFluxTestOneControllerIntegrationTests {
@Test
public void shouldFindController() {
this.webClient.get().uri("/one").exchange().expectStatus().isOk()
.expectBody(String.class).value().isEqualTo("one");
.expectBody(String.class).isEqualTo("one");
}
@Test

4
spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java

@ -48,13 +48,13 @@ public class WebTestClientSpringBootTestIntegrationTests { @@ -48,13 +48,13 @@ public class WebTestClientSpringBootTestIntegrationTests {
@Test
public void shouldFindController1() {
this.webClient.get().uri("/one").exchange().expectStatus().isOk()
.expectBody(String.class).value().isEqualTo("one");
.expectBody(String.class).isEqualTo("one");
}
@Test
public void shouldFindController2() {
this.webClient.get().uri("/two").exchange().expectStatus().isOk()
.expectBody(String.class).value().isEqualTo("two");
.expectBody(String.class).isEqualTo("two");
}
@Test

4
spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java

@ -67,13 +67,13 @@ public abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests @@ -67,13 +67,13 @@ public abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests
public void runAndTestHttpEndpoint() {
assertThat(this.port).isNotEqualTo(8080).isNotEqualTo(0);
WebTestClient.bindToServer().baseUrl("http://localhost:" + this.port).build()
.get().uri("/").exchange().expectBody(String.class).value()
.get().uri("/").exchange().expectBody(String.class)
.isEqualTo("Hello World");
}
@Test
public void injectWebTestClient() {
this.webClient.get().uri("/").exchange().expectBody(String.class).value()
this.webClient.get().uri("/").exchange().expectBody(String.class)
.isEqualTo("Hello World");
}

Loading…
Cancel
Save