Add coverage for ConfigResourceNode-4
[appc.git] / appc-config / appc-data-services / provider / src / test / java / org / onap / appc / data / services / node / MockDbServiceBuilder.java
index e7198b2..40bf697 100644 (file)
@@ -1,7 +1,6 @@
 package org.onap.appc.data.services.node;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -16,10 +15,6 @@ class MockDbServiceBuilder {
 
     MockDbServiceBuilder() throws SvcLogicException {
         dbServiceMock = mock(DGGeneralDBService.class);
-
-        doReturn(SvcLogicResource.QueryStatus.SUCCESS)
-            .when(dbServiceMock)
-            .getConfigFileReferenceByFileTypeNVnfType(any(SvcLogicContext.class), anyString(), anyString());
     }
 
     MockDbServiceBuilder getConfigFileReferenceByFileTypeNVnfType(String prefix, String fileType, SvcLogicResource.QueryStatus status) throws SvcLogicException {
@@ -102,6 +97,30 @@ class MockDbServiceBuilder {
         return this;
     }
 
+    public MockDbServiceBuilder saveUploadConfig(String prefix, SvcLogicResource.QueryStatus status) throws SvcLogicException {
+        doReturn(status)
+            .when(dbServiceMock)
+            .saveUploadConfig(any(SvcLogicContext.class), eq(prefix));
+
+        return this;
+    }
+
+    public MockDbServiceBuilder getUploadConfigInfo(String prefix, SvcLogicResource.QueryStatus status) throws SvcLogicException {
+        doReturn(status)
+            .when(dbServiceMock)
+            .getUploadConfigInfo(any(SvcLogicContext.class), eq(prefix));
+
+        return this;
+    }
+
+    public MockDbServiceBuilder updateUploadConfig(String prefix, int maxId, SvcLogicResource.QueryStatus status) throws SvcLogicException {
+        doReturn(status)
+            .when(dbServiceMock)
+            .updateUploadConfig(any(SvcLogicContext.class), eq(prefix), eq(maxId));
+
+        return this;
+    }
+
     DGGeneralDBService build() {
         return dbServiceMock;
     }