Skip to content

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

Closed
@jelmerk

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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