I need to test mqqt behaviors and events emitted by mqtt. E.g whenever I(mock device) publish to mqtt, the Handler gets called by it with valid params(tested this with iex but needs to automate the process) and I performs some actions on the data.
- installed mqqt via docker container
- added tortoise dependency to my elixir project
- and added basic listner
- and tried in console and listen successfully
Tortoise.publish(:client_id, "d", "my msg" , qos: 0).
Note: I tried to use
mox libraries for listening but unable to capture the call event
Question/issue: Mqtt listens to events(some device publish events to mqqt server) and Mqtt calls an elixir listener associated with it. I need to test this behavior: Lets say listener get called by mqqt within 10 seconds. How do I check inside test cases that this method/listener has been called within 10 seconds(with correct params) after I initiate a publish to mqqt