Add UT for port-dependent auth function.

Allow specifying the transport when injecting a message direct
to one module.