diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/pom.xml b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/pom.xml
index 179094b..2c34c5e 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/pom.xml
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/pom.xml
@@ -188,6 +188,12 @@
             <version>${apache.httpcomponents.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>${apache.httpcomponents.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.onap.ccsdk.sli.core</groupId>
             <artifactId>sli-common</artifactId>
             <scope>compile</scope>
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/Constants.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/Constants.java
index 908c42c..ba88be5 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/Constants.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/Constants.java
@@ -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.
@@ -32,47 +34,47 @@
     /**
      * Manifest attribute for OSGI Bundle Name
      */
-    public static final String MANIFEST_ATTR_BUNDLE_NAME= "Bundle-Name";
+    public static final String MANIFEST_ATTR_BUNDLE_NAME = "Bundle-Name";
 
     /**
      * Manifest attribute for OSGI Bundle Symbolic Name
      */
-    public static final String MANIFEST_ATTR_BUNDLE_SYMBOLIC_NAME= "Bundle-SymbolicName";
+    public static final String MANIFEST_ATTR_BUNDLE_SYMBOLIC_NAME = "Bundle-SymbolicName";
 
     /**
      * Manifest attribute for OSGI Bundle Description
      */
-    public static final String MANIFEST_ATTR_BUNDLE_DESCRIPTION= "Bundle-Description";
+    public static final String MANIFEST_ATTR_BUNDLE_DESCRIPTION = "Bundle-Description";
 
     /**
      * Manifest attribute for OSGI Bundle Manifest version
      */
-    public static final String MANIFEST_ATTR_BUNDLE_MANIFEST_VERSION= "Bundle-ManifestVersion";
+    public static final String MANIFEST_ATTR_BUNDLE_MANIFEST_VERSION = "Bundle-ManifestVersion";
 
     /**
      * Manifest attribute for OSGI Bundle Version
      */
-    public static final String MANIFEST_ATTR_BUNDLE_VERSION= "Bundle-Version";
+    public static final String MANIFEST_ATTR_BUNDLE_VERSION = "Bundle-Version";
 
     /**
      * Manifest attribute for OSGI Bundle Blueprint
      */
-    public static final String MANIFEST_ATTR_BUNDLE_BLUEPRINT= "Bundle-Blueprint";
+    public static final String MANIFEST_ATTR_BUNDLE_BLUEPRINT = "Bundle-Blueprint";
 
     /**
      * Manifest value for Mainfest Version
      */
-    public static final String MANIFEST_VALUE_VERSION= "1.0";
+    public static final String MANIFEST_VALUE_VERSION = "1.0";
 
     /**
      * Manifest value for OSGI Bundle Vesion
      */
-    public static final String MANIFEST_VALUE_BUNDLE_MAN_VERSION= "2";
+    public static final String MANIFEST_VALUE_BUNDLE_MAN_VERSION = "2";
 
     /**
      * Manifest value for OSGI Bundle Blueprint location
      */
-    public static final String MANIFEST_VALUE_BUNDLE_BLUEPRINT= "OSGI-INF/blueprint/blueprint.xml";
+    public static final String MANIFEST_VALUE_BUNDLE_BLUEPRINT = "OSGI-INF/blueprint/blueprint.xml";
 
     /**
      * Base URL for config actions exposed by RESTCONF API
@@ -110,12 +112,12 @@
     /**
      * HTTP Header attribute for Content type - JSON
      */
-    public static final String OPERATION_APPLICATION_JSON= " application/json";
+    public static final String OPERATION_APPLICATION_JSON = " application/json";
 
     /**
      * HTTP protocol used for config operations
      */
-    public static final String OPERATION_HTTPS= "https";
+    public static final String OPERATION_HTTPS = "https";
 
     /**
      *  Constant for backslash to be used while formatting URL
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/MDSALStoreImpl.java b/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
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/MDSALStoreImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/impl/MDSALStoreImpl.java
@@ -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 @@
         }
         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 @@
                     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 @@
             throw new MDSALStoreException(e);
         }
     }
+
+    protected RestClientInvoker getRestClientInvoker(URL configUrl) throws MalformedURLException {
+        return new RestClientInvoker(configUrl);
+    }
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/objects/BundleInfo.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/objects/BundleInfo.java
index 2f11b88..1399929 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/objects/BundleInfo.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/objects/BundleInfo.java
@@ -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.
@@ -36,7 +38,7 @@
      * Creates an object of BundleInfo with version initialized to 1
      */
     public BundleInfo(){
-        version =1;
+        version = 1;
     }
 
     public String getName() {
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/operation/ConfigOperationRequestFormatter.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/operation/ConfigOperationRequestFormatter.java
index 5ebe58b..e565f20 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/operation/ConfigOperationRequestFormatter.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/operation/ConfigOperationRequestFormatter.java
@@ -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.
@@ -39,7 +41,7 @@
      */
     public String buildPath(String module, String containerName , String... subModules ) {
 
-        StringBuilder path = new StringBuilder( Constants.CONFIG_PATH + Constants.URL_BACKSLASH + module + ":"+containerName + Constants.URL_BACKSLASH);
+        StringBuilder path = new StringBuilder( Constants.CONFIG_PATH + Constants.URL_BACKSLASH + module + ":" + containerName + Constants.URL_BACKSLASH);
         if(subModules.length >0){
             for(String subModule : subModules){
                 path.append(subModule);
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/provider/MdsalStoreProvider.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/provider/MdsalStoreProvider.java
index 18ff522..545bd32 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/provider/MdsalStoreProvider.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/main/java/org/onap/appc/mdsal/provider/MdsalStoreProvider.java
@@ -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.
@@ -23,9 +25,15 @@
 
 package org.onap.appc.mdsal.provider;
 
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.google.common.util.concurrent.Futures;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import org.onap.appc.Constants;
+import org.onap.appc.mdsal.MDSALStore;
+import org.onap.appc.mdsal.impl.MDSALStoreFactory;
+import org.onap.appc.mdsal.objects.BundleInfo;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -38,16 +46,9 @@
 import org.opendaylight.yang.gen.v1.org.onap.appc.mdsal.store.rev170925.response.StatusBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.onap.appc.Constants;
-import org.onap.appc.mdsal.MDSALStore;
-import org.onap.appc.mdsal.impl.MDSALStoreFactory;
-import org.onap.appc.mdsal.objects.BundleInfo;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.common.util.concurrent.Futures;
 
 public class MdsalStoreProvider implements MdsalStoreService ,AutoCloseable{
 
@@ -90,7 +91,8 @@
 
     @Override
     public Future<RpcResult<StoreYangOutput>> storeYang(StoreYangInput input) {
-        Status status =null;String message=null;
+        Status status = null;
+        String message = null;
         try{
             BundleInfo bundleInfo = new BundleInfo();
             bundleInfo.setName(input.getModuleName());
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java
index 9469df6..2229eff 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java
@@ -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.
@@ -24,10 +26,8 @@
 package org.onap.appc.mdsal;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.http.HttpResponse;
 import org.junit.Before;
 import org.junit.Ignore;
-import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mockito;
 import org.onap.appc.mdsal.exception.MDSALStoreException;
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/impl/MDSALStoreImplTest.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/impl/MDSALStoreImplTest.java
new file mode 100644
index 0000000..fa11462
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/impl/MDSALStoreImplTest.java
@@ -0,0 +1,194 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.mdsal.impl;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.nio.charset.Charset;
+import java.util.Date;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.appc.exceptions.APPCException;
+import org.onap.appc.mdsal.MDSALStore;
+import org.onap.appc.mdsal.exception.MDSALStoreException;
+import org.onap.appc.mdsal.objects.BundleInfo;
+import org.onap.appc.rest.client.RestClientInvoker;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+import com.att.eelf.configuration.EELFLogger;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import java.net.URL;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(FrameworkUtil.class)
+public class MDSALStoreImplTest {
+
+    private final BundleContext bundleContext= Mockito.mock(BundleContext.class);
+    private final Bundle bundleService=Mockito.mock(Bundle.class);
+    private MDSALStoreImpl mdsalStore;
+
+    @Rule
+    public ExpectedException expectedEx = ExpectedException.none();
+
+    @Before
+    public void setup() {
+        mdsalStore = (MDSALStoreImpl) MDSALStoreFactory.createMDSALStore();
+        PowerMockito.mockStatic(FrameworkUtil.class);
+        PowerMockito.when(FrameworkUtil.getBundle(MDSALStoreImpl.class)).thenReturn(bundleService);
+        PowerMockito.when(bundleService.getBundleContext()).thenReturn(bundleContext);
+        PowerMockito.when(bundleContext.getBundle("TEST_MODULE_NAME")).thenReturn(bundleService);
+    }
+
+    @Test
+    public void testMDSALStoreImpl() {
+        Assert.assertTrue(mdsalStore.isModulePresent("TEST_MODULE_NAME", new Date()));
+    }
+
+    @Test
+    public void testStoreYangModule() throws MDSALStoreException {
+        expectedEx.expect(MDSALStoreException.class);
+        expectedEx.expectMessage("Error storing yang module:");
+        mdsalStore.storeYangModule("", new BundleInfo());
+    }
+
+    @Test
+    public void testStoreYangModuleOnLeader() throws MDSALStoreException, APPCException, IllegalStateException, IOException {
+        RestClientInvoker mockInvoker = Mockito.mock(RestClientInvoker.class);
+        Whitebox.setInternalState(mdsalStore, "client", mockInvoker);
+        HttpResponse mockResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockResponse).when(mockInvoker).doGet(Constants.GET_SHARD_LIST_PATH);
+        String httpString = "{\"value\":{\"MemberName\":\"NodeName\"}}";
+        InputStream is = new ByteArrayInputStream(httpString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(is).when(mockEntity).getContent();
+        Mockito.doReturn(mockEntity).when(mockResponse).getEntity();
+        StatusLine mockStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockStatusLine).when(mockResponse).getStatusLine();
+        Mockito.doReturn(200).when(mockStatusLine).getStatusCode();
+        HttpResponse mockLeaderResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockLeaderResponse).when(mockInvoker).doGet(String.format(Constants.GET_NODE_STATUS_PATH_FORMAT, "NodeName-shard-default-config"));
+        String httpLeaderString = "{\"value\":{\"Leader\":\"NodeName-shard-default-config\"}}";
+        InputStream isLeader = new ByteArrayInputStream(httpLeaderString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockLeaderEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(isLeader).when(mockLeaderEntity).getContent();
+        Mockito.doReturn(mockLeaderEntity).when(mockLeaderResponse).getEntity();
+        StatusLine mockLeaderStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockLeaderStatusLine).when(mockLeaderResponse).getStatusLine();
+        Mockito.doReturn(200).when(mockLeaderStatusLine).getStatusCode();
+        EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
+        Whitebox.setInternalState(mdsalStore, "logger", mockLogger);
+        mdsalStore.storeYangModuleOnLeader("", "");
+        Mockito.verify(mockLogger).debug("Current node is a leader.");
+    }
+    
+    @Test
+    public void testStoreYangModuleOnLeaderNotLeader() throws MDSALStoreException, APPCException, IllegalStateException, IOException {
+        RestClientInvoker mockInvoker = Mockito.mock(RestClientInvoker.class);
+        Whitebox.setInternalState(mdsalStore, "client", mockInvoker);
+        HttpResponse mockResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockResponse).when(mockInvoker).doGet(Constants.GET_SHARD_LIST_PATH);
+        String httpString = "{\"value\":{\"MemberName\":\"NodeName\"}}";
+        InputStream is = new ByteArrayInputStream(httpString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(is).when(mockEntity).getContent();
+        Mockito.doReturn(mockEntity).when(mockResponse).getEntity();
+        StatusLine mockStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockStatusLine).when(mockResponse).getStatusLine();
+        Mockito.doReturn(200).when(mockStatusLine).getStatusCode();
+        HttpResponse mockLeaderResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockLeaderResponse).when(mockInvoker).doGet(String.format(Constants.GET_NODE_STATUS_PATH_FORMAT, "NodeName-shard-default-config"));
+        String httpLeaderString = "{\"value\":{\"Leader\":\"OtherShardName\",\"PeerAddresses\":\"OtherShardName@adf:a\"}}";
+        InputStream isLeader = new ByteArrayInputStream(httpLeaderString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockLeaderEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(isLeader).when(mockLeaderEntity).getContent();
+        Mockito.doReturn(mockLeaderEntity).when(mockLeaderResponse).getEntity();
+        StatusLine mockLeaderStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockLeaderStatusLine).when(mockLeaderResponse).getStatusLine();
+        Mockito.doReturn(200).when(mockLeaderStatusLine).getStatusCode();
+        MDSALStoreImpl mdsalStoreSpy = Mockito.spy((MDSALStoreImpl) MDSALStoreFactory.createMDSALStore());
+        RestClientInvoker mockRemoteInvoker = Mockito.mock(RestClientInvoker.class);
+        Mockito.doReturn(mockRemoteInvoker).when(mdsalStoreSpy).getRestClientInvoker(Mockito.any(URL.class));
+        StatusLine mockRemoteStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(200).when(mockRemoteStatusLine).getStatusCode();
+        HttpResponse mockLeaderRemoteResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockLeaderResponse).when(mockRemoteInvoker).doPost(Mockito.anyString(), Mockito.anyString());
+        Mockito.doReturn(mockRemoteStatusLine).when(mockLeaderRemoteResponse).getStatusLine();
+        EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
+        Whitebox.setInternalState(mdsalStoreSpy, "logger", mockLogger);
+        mdsalStoreSpy.storeYangModuleOnLeader("", "");
+        Mockito.verify(mockLogger).debug("Yang module successfully loaded on leader. Response code: 200");
+    }
+
+    @Test
+    public void testStoreJson() throws MDSALStoreException, APPCException, IllegalStateException, IOException {
+        RestClientInvoker mockInvoker = Mockito.mock(RestClientInvoker.class);
+        Whitebox.setInternalState(mdsalStore, "client", mockInvoker);
+        HttpResponse mockResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockResponse).when(mockInvoker).doPut(Mockito.anyString(), Mockito.anyString());
+        String httpString = "{\"value\":{\"MemberName\":\"NodeName\"}}";
+        InputStream is = new ByteArrayInputStream(httpString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(is).when(mockEntity).getContent();
+        Mockito.doReturn(mockEntity).when(mockResponse).getEntity();
+        StatusLine mockStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockStatusLine).when(mockResponse).getStatusLine();
+        Mockito.doReturn(200).when(mockStatusLine).getStatusCode();
+        EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
+        Whitebox.setInternalState(mdsalStore, "logger", mockLogger);
+        mdsalStore.storeJson("", "", "");
+        Mockito.verify(mockLogger).debug("Configuration JSON stored to MD-SAL store successfully. Response code: 200");
+    }
+
+    @Test
+    public void testStoreJsonRestconfResponse() throws MDSALStoreException, APPCException, IllegalStateException, IOException {
+        RestClientInvoker mockInvoker = Mockito.mock(RestClientInvoker.class);
+        Whitebox.setInternalState(mdsalStore, "client", mockInvoker);
+        HttpResponse mockResponse = Mockito.mock(HttpResponse.class);
+        Mockito.doReturn(mockResponse).when(mockInvoker).doPut(Mockito.anyString(), Mockito.anyString());
+        String httpString = "{\"errors\":{\"error\":{\"error-message\":{\"error-message\":\"ERROR_MESSAGE\"}}}}";
+        InputStream is = new ByteArrayInputStream(httpString.getBytes(Charset.defaultCharset()));
+        HttpEntity mockEntity = Mockito.mock(HttpEntity.class);
+        Mockito.doReturn(is).when(mockEntity).getContent();
+        Mockito.doReturn(mockEntity).when(mockResponse).getEntity();
+        StatusLine mockStatusLine = Mockito.mock(StatusLine.class);
+        Mockito.doReturn(mockStatusLine).when(mockResponse).getStatusLine();
+        Mockito.doReturn(199).when(mockStatusLine).getStatusCode();
+        expectedEx.expect(MDSALStoreException.class);
+        expectedEx.expectMessage("Failed to load config JSON to MD SAL store. Error Message:");
+        mdsalStore.storeJson("", "", "");
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/provider/MdsalStoreProviderTest.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/provider/MdsalStoreProviderTest.java
new file mode 100644
index 0000000..2f0e493
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/provider/MdsalStoreProviderTest.java
@@ -0,0 +1,80 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.mdsal.provider;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.appc.mdsal.MDSALStore;
+import org.onap.appc.mdsal.impl.MDSALStoreFactory;
+import org.onap.appc.mdsal.impl.MDSALStoreImpl;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.yang.gen.v1.org.onap.appc.mdsal.store.rev170925.MdsalStoreService;
+import org.opendaylight.yang.gen.v1.org.onap.appc.mdsal.store.rev170925.StoreYangInput;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+import com.att.eelf.configuration.EELFLogger;
+import org.junit.Assert;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(MDSALStoreFactory.class)
+public class MdsalStoreProviderTest {
+
+    private DataBroker dataBroker = Mockito.mock(DataBroker.class);
+    private RpcProviderRegistry rpcRegistry = Mockito.mock(RpcProviderRegistry.class);
+    private NotificationProviderService notificationService = Mockito.mock(NotificationProviderService.class);
+
+    @Test
+    public void testClose() throws Exception {
+        EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
+        MdsalStoreProvider mdsalStoreProvider = new MdsalStoreProvider(dataBroker, notificationService, rpcRegistry);
+        Whitebox.setInternalState(mdsalStoreProvider, "log", mockLogger);
+        mdsalStoreProvider.close();
+        Mockito.verify(mockLogger).info("Closing provider for MdsalStoreProvider");
+        Mockito.verify(mockLogger).info("Successfully closed provider for MdsalStoreProvider");
+    }
+
+    @Test
+    public void testStoreYang() throws Exception {
+        PowerMockito.mockStatic(MDSALStoreFactory.class);
+        MDSALStore mdsalStore = Mockito.mock(MDSALStore.class);
+        PowerMockito.when(MDSALStoreFactory.createMDSALStore()).thenReturn(mdsalStore);
+        MdsalStoreProvider mdsalStoreProvider = new MdsalStoreProvider(dataBroker, notificationService, rpcRegistry);
+        StoreYangInput mockInput = Mockito.mock(StoreYangInput.class);
+        Assert.assertNotNull(mdsalStoreProvider.storeYang(mockInput));
+    }
+
+    @Test
+    public void testStoreYangExceptionFlow() throws Exception {
+        EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
+        MdsalStoreProvider mdsalStoreProvider = new MdsalStoreProvider(dataBroker, notificationService, rpcRegistry);
+        Whitebox.setInternalState(mdsalStoreProvider, "log", mockLogger);
+        StoreYangInput mockInput = Mockito.mock(StoreYangInput.class);
+        mdsalStoreProvider.storeYang(mockInput);
+        Mockito.verify(mockLogger).error(Mockito.anyString(), Mockito.any(NullPointerException.class));
+    }
+}
