To allow our tests to use internal esp-mqtt state without exposing it directly we add this utility to capture it.