Add tests for complexGateway