https://linen.dev logo
#wiremock-java
Title
# wiremock-java
h

Hantsy Bai

12/14/2023, 1:31 AM
Is it possible to mock a SSE with Quarkus client, I have tried to write the sse data stream into response, it does not work https://github.com/hantsy/quarkus-sandbox/blob/master/restclient-reactive/src/test/java/com/example/demo/PostResourceClientTest.java#L164-L203, and check Github action build log, https://github.com/hantsy/quarkus-sandbox/actions/runs/7157943180/job/19489420848#step:5:56
t

Tom

12/14/2023, 10:07 AM
I’ve never tried this but since SSE is (as far as I know) just a set of conventions on top of standard HTTP, I think you could send a finite set of events by configuring a stub in the normal way that returns a
text/event-stream
content-type header with the body structured according to the standard.
If you wanted to create delays you could get something approximate by using chunked dribble delay (the main constraint being that you have to set a specific chunk size so unless your messages are equal in size they might get scheduled in multiple chunks)
6 Views