Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutboundSseEvent is not correctly serialized #29623

Merged
merged 1 commit into from
Dec 3, 2022
Merged

OutboundSseEvent is not correctly serialized #29623

merged 1 commit into from
Dec 3, 2022

Conversation

mailq
Copy link

@mailq mailq commented Dec 1, 2022

Closes #10673

This request allows special server sent events in the form of

  @GET
  @Produces(MediaType.SERVER_SENT_EVENTS)
  public Multi<OutboundSseEvent> consume(@Context Sse sse) {
    return Multi.createFrom()
        .item(sse.newEventBuilder().id(UUID.randomUUID().toString())
            .mediaType(MediaType.TEXT_HTML_TYPE).name("whatever").data("<h3>EVENT DATA</h3>")
            .reconnectDelay(3000).build());
  }

I'd like to write a test for that, but there is no existing one for the changed class. That's probably due to the static access of SseUtil.send() which is impossible to mock (as far as I know).

@geoand
Copy link
Contributor

geoand commented Dec 2, 2022

Thanks for this!

We definitely would like to have a test, probably similar to the ones here.

@quarkus-bot quarkus-bot bot added the area/rest label Dec 2, 2022
@mailq
Copy link
Author

mailq commented Dec 2, 2022

Thank you. I that was helpful.

I added the requested test.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 3, 2022

Failing Jobs - Building dc5f031

Status Name Step Failures Logs Raw logs
✔️ Gradle Tests - JDK 11
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 11
✔️ JVM Tests - JDK 17
JVM Tests - JDK 17 MacOS M1 Set up runner ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 18

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.devmode.MultiSourceProjectDevModeTest.main line 22 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.test.devmode.util.DevModeTestUtils that uses java.util.function.Supplier, java.util.function.Supplierjava.util.concurrent.atomic.AtomicReference, java.util.concurrent.atomic.AtomicReferencejava.lang.String, java.lang.Stringboolean was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

@geoand geoand merged commit 1a5dd2a into quarkusio:main Dec 3, 2022
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 3, 2022
@gsmet gsmet modified the milestones: 2.16 - main, 2.15.0.Final Dec 6, 2022
@gsmet gsmet modified the milestones: 2.15.0.Final, 2.13.6.Final Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OutboundSseEvent is not correctly serialized
3 participants