Added test for GatewayFactory