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

MockClientHttpResponse should not return null body

    XMLWordPrintable

    Details

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

      Description

      According to HttpInputMessage documentation body can never be null, although this is not true when you create mock response using MockRestResponseCreators without body, e.g. withBadRequest() or withSuccess().

      Looks like changes should be done in MockHttpInputMessage to set ByteArrayInputStream with empty byte array if passed content is null. As well null check before closing stream in MockClientHttpResponse may be removed.

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            gavlyukovskiy Arthur Gavlyukovskiy
            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, 37 weeks, 6 days ago