Add unit tests for gateways