Test coverage in appc-dg-mdsal-bundle
[appc.git] / appc-dg / appc-dg-shared / appc-dg-mdsal-store / appc-dg-mdsal-bundle / src / main / java / org / onap / appc / mdsal / impl / MDSALStoreImpl.java
index 2ef1da3..8f7bfab 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -83,7 +85,7 @@ public class MDSALStoreImpl implements MDSALStore {
         }
         if (configUrl != null) {
             try {
-                client = new RestClientInvoker(new URL(configUrl));
+                client = getRestClientInvoker(new URL(configUrl));
                 client.setAuthentication(user, password);
             } catch (MalformedURLException e) {
                 logger.error("Error initializing RestConf client: " + e.getMessage(), e);
@@ -187,7 +189,7 @@ public class MDSALStoreImpl implements MDSALStore {
                     URL configUrl = new URL(properties.getProperty(Constants.CONFIG_URL_PROPERTY, Constants.CONFIG_URL_DEFAULT));
                     String user = properties.getProperty(Constants.CONFIG_USER_PROPERTY);
                     String password = properties.getProperty(Constants.CONFIG_PASS_PROPERTY);
-                    RestClientInvoker remoteClient = new RestClientInvoker(new URL(configUrl.getProtocol(), leader, configUrl.getPort(), ""));
+                    RestClientInvoker remoteClient = getRestClientInvoker(new URL(configUrl.getProtocol(), leader, configUrl.getPort(), ""));
                     remoteClient.setAuthentication(user, password);
                     remoteClientMap.put(leader, remoteClient);
                     return remoteClient;
@@ -350,4 +352,8 @@ public class MDSALStoreImpl implements MDSALStore {
             throw new MDSALStoreException(e);
         }
     }
+
+    protected RestClientInvoker getRestClientInvoker(URL configUrl) throws MalformedURLException {
+        return new RestClientInvoker(configUrl);
+    }
 }