Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17522

WebTestClient.BodySpec.isEmpty() returns false on byte[0]

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.0.9
    • Fix Version/s: 5.1.3
    • Component/s: Test
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            mowol mowol
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 29 weeks, 6 days ago