Skip to content

WebTestClient.BodySpec.isEmpty() returns false on byte[0] [SPR-17522] #22054

@spring-projects-issues

Description

@spring-projects-issues

mowol opened SPR-17522 and commented

WebTestClient.BodySpec.isEmpty() returns false on a Mono.empty().

In debug-view the responseBody is a MonoProcessor with a value of byte[0].

 

Interestingly enough, WebTestClient.BodySpec.getBodyAsString() has the following code:

if (body == null || body.length == 0) {		
   return "";		
}

where a byte[0] would be considered empty.


Affects: 5.0.9

Referenced from: commits 759013e

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions