I’m trying to figure out how to set a check on unmatched messages.
I have something similar to:
sse("SSE").get("/events")
.await(10).on(
sse.checkMessage("Old events present")
.check(substring("OLD_EVENT"))
)
http("add event")
.post("/event")
.body(StringBody(json))
.asJson()
sse.setCheck()
.await(10).on(
sse.checkMessage("Check for event")
.check(substring("NEW_CONTENT"))
)
This fails because the SSE event occurred before the setCheck command executed. I can see the event in ws.processUnmatchedMessages. Is there a way to get the setCheck command to also run on the unmatchedMessages? Something like:
sse("check").setCheck()
.await(10).on(
sse.checkMessage("new check")
.includeMessagesInBuffer(true)
.check(substring("NEW_EVENT"))
)