Testing SSE endpoints with JavalinTest
See original GitHub issueProblem:
I want to achieve the maximum coverage of my controller tests.
What have I managed so far:
By following this tutorial I’ve managed to write a test that covers every normal method on my controller using the “Functional/integration” methodology described by the tutorial.
What I want to do:
listenToParameterChanges
is a method on my controller invoked by an SSE declaration in my server description.
I want to make sure that method is also tested properly, is there a way to test it while maintaining the same methodology or should I change my methodology to the one described under “Unit” on the tutorial to cover that portion of my controller?
Issue Analytics
- State:
- Created a year ago
- Comments:38 (25 by maintainers)
Top Results From Across the Web
How to test server sent events with Spring? - Stack Overflow
... verifier for testing the Server Sent Event (SSE). Need to create WebTestClient object and make a call to endpoint. Below is an...
Read more >Testing Javalin Applications
Since Javalin is a library, there are no requirements for how tests must be written. This guide will outline a few common approaches....
Read more >Server Sent Events — Development & Test Automation
Establish a SSE connection to REST endpoint exposed by sse-server project. This is achieved with EventSource java object . This project has ...
Read more >Mocking server sent events: Development and CI
Posted Nov 21, 2018 in Testing by Tim Vierbergen ... Although Node-RED has add-ons for SSE, I decided to start writing one myself....
Read more >How to Load Test SSE Services with JMeter - BlazeMeter
In this post we will show you two ways to load test SSE with JMeter: by using Groovy or a Java Sampler.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dzikoysk https://github.com/tipsy/javalin/commit/0e947377724bd32da28b1707a33c9d79b9f53386
Turns out we have two bugs:
closeCallback
when the user manually callsclose()
I changed the
close()
method to also trigger thecloseCallback
, then I called theclose()
whenever the emitter is closed. This should fix both bugs.@tipsy sorry for the delayed answer.
I believe that wold be perfect.
I’ll give it a shot with
okhttp-sse
as well.