Skip to content

ServerSentEvent should implement equals() and hashCode() #33606

@jelmerk

Description

@jelmerk

ServerSentEvent is an immutable class but does not implement equals and hashCode.

So something like this does not work:

        StepVerifier.create(responseBodyFlux)
            .expectNext(ServerSentEvent.builder(ChatResponseMessage("And")).build())

And instead it forces you to write something like this:

        StepVerifier.create(responseBodyFlux)
            .consumeNextWith { event -> assertThat(event.data()?.text).isEqualTo("And") }

which is both inconvenient and unexpected.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions