From 759013eb17cf1a0d6ecd69b0769f90a74cae6f87 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 20 Nov 2018 23:02:53 -0500 Subject: [PATCH] Consistent isEmpty check in WebTestClient Issue: SPR-17522 --- .../test/web/reactive/server/DefaultWebTestClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java b/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java index 178a1593dd..53bdffd3fe 100644 --- a/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java +++ b/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java @@ -479,7 +479,7 @@ class DefaultWebTestClient implements WebTestClient { DefaultBodyContentSpec(EntityExchangeResult result) { this.result = result; - this.isEmpty = (result.getResponseBody() == null); + this.isEmpty = (result.getResponseBody() == null || result.getResponseBody().length == 0); } @Override