The new lazy initialization logic in GetMessanger() (lines 166-214) lacks test coverage. This includes critical paths like:
- Environment variable fallback logic (MQTT_BROKER, MQTT_USERNAME, MQTT_PASSWORD)
- The "address already in use" error handling for the embedded broker
- The config priority (config -> env vars -> default)
- The fallthrough from "otto" case to default case
The existing TestGetMessanger only tests singleton behavior after NewMessanger is called, not the lazy initialization path. Consider adding table-driven tests that exercise these scenarios.
Originally posted by @Copilot in #34 (comment)
The new lazy initialization logic in
GetMessanger()(lines 166-214) lacks test coverage. This includes critical paths like:The existing
TestGetMessangeronly tests singleton behavior afterNewMessangeris called, not the lazy initialization path. Consider adding table-driven tests that exercise these scenarios.Originally posted by @Copilot in #34 (comment)