Browse Source

Fix broken assertions in tests

This commit also restores the HTTP response body
assertion that has been dropped in 5873ddd.

See gh-26162
pull/26167/head
izeye 5 years ago committed by Stephane Nicoll
parent
commit
e53453c69c
  1. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
  2. 3
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java

@ -469,7 +469,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { @@ -469,7 +469,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
try {
ContentResponse response = client.POST("http://localhost:" + this.webServer.getPort())
.content(new StringContentProvider("Hello World"), "text/plain").send();
assertThat(response.getStatus() == HttpStatus.OK.value());
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(response.getContentAsString()).isEqualTo("Hello World");
}
finally {

3
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

@ -1139,7 +1139,8 @@ public abstract class AbstractServletWebServerFactoryTests { @@ -1139,7 +1139,8 @@ public abstract class AbstractServletWebServerFactoryTests {
client.start();
try {
ContentResponse response = client.GET("http://localhost:" + this.webServer.getPort() + "/hello");
assertThat(response.getStatus() == HttpStatus.OK.value());
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(response.getContentAsString()).isEqualTo("Hello World");
}
finally {
client.stop();

Loading…
Cancel
Save