Skip to content

Commit 0b061d9

Browse files
committed
Fix tests
1 parent b7cf789 commit 0b061d9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/factory/GatewayHolder.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ public static GatewayDeployer getTenantGatewayInstance(String organization, Stri
9999
if (environment != null) {
100100
GatewayAgentConfiguration gatewayAgentConfiguration = ServiceReferenceHolder.getInstance().
101101
getExternalGatewayConnectorConfiguration(environment.getGatewayType());
102-
GatewayDeployer deployer = (GatewayDeployer) Class.forName(gatewayAgentConfiguration.getImplementation())
103-
.getDeclaredConstructor().newInstance();
104-
deployer.init(environment);
105-
return deployer;
102+
if (gatewayAgentConfiguration != null) {
103+
GatewayDeployer deployer = (GatewayDeployer) Class.forName(gatewayAgentConfiguration.getImplementation())
104+
.getDeclaredConstructor().newInstance();
105+
deployer.init(environment);
106+
return deployer;
107+
108+
}
109+
return null;
106110
}
107111
} catch (APIManagementException | ClassNotFoundException | NoSuchMethodException |
108112
InstantiationException | IllegalAccessException | InvocationTargetException e) {

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/notifier/ExternalGatewayNotifier.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@
4242
import java.util.Set;
4343

4444
public class ExternalGatewayNotifier extends DeployAPIInGatewayNotifier {
45-
protected ApiMgtDAO apiMgtDAO;
45+
protected ApiMgtDAO apiMgtDAO = ApiMgtDAO.getInstance();
4646
private static final Log log = LogFactory.getLog(ExternalGatewayNotifier.class);
4747

4848
@Override
4949
public boolean publishEvent(Event event) throws NotifierException {
5050
if (APIUtil.isAnyExternalGateWayProviderExists(event.getTenantDomain())) {
51-
apiMgtDAO = ApiMgtDAO.getInstance();
5251
process(event);
5352
}
5453
return true;

0 commit comments

Comments
 (0)