Hi every1 O have question regarding wiremock grpc ...
# help
t
Hi every1 O have question regarding wiremock grpc streaming. Does it support keeping channel alive(for next updates) after reaching to it for the 1st time?
t
No, it doesn’t support this at the moment. We’d like to do something like this in future, but it’ll possibly require some changes to WireMock core (to do it in a non-messy way at least)
Can you share the specifics of the test case you’d like to build?
t
Test scenario: My tested service(later called
client
) is establishing at start grpc stream channel with
server
client
gets data from server and listens for updaye from it(channel is up all the time). Whenever
server
have something new to share it send via channel immediatelly to
client
.
t
In a mocking scenario what would you want to be the trigger for new data from the server? And what would trigger the end of the stream?
t
Trigger for new data I think updating current stub & updating it would do a work. Rerigesting it under the same mappingId. In this scensrio end of streaming: On side of client it would be terminating client On side server(wiremock) unregistering mock
t
OK, thanks for letting me know. I think we probably wouldn’t want to require removal of the stub as a trigger to end the stream as this would get really tricky where there are concurrent requests active. But perhaps an additional API you could use to trigger the termination for matching streams would do the trick. Likewise I think an additional API you could call to add messages to an existing stream would probably be neater than mutating the stub itself.