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 4 years ago committed by Stephane Nicoll
parent 57d35aba12
commit e53453c69c

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

@ -1139,7 +1139,8 @@ public abstract class AbstractServletWebServerFactoryTests {
client.start(); client.start();
try { try {
ContentResponse response = client.GET("http://localhost:" + this.webServer.getPort() + "/hello"); 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 { finally {
client.stop(); client.stop();

Loading…
Cancel
Save