Skip to content

Different behavior between RestTestClient and WebTestClient #35590

@lukas-krecan

Description

@lukas-krecan

There is an inconsistency between WebTestClient and RestTestClient when the controller does not return any body. exec("/empty").returnResult().getResponseBody() in WebTestClient returns an empty byte[] while RestTestClient returns null.

See the reproducer here https://github.com/lukas-krecan/JsonUnit/compare/reproducer?expand=1

It's not a big deal, feel free to close it if it is intentional. I was just a bit surprised by that and thought you may not be aware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions