diff options
Diffstat (limited to 'ueb-listener/src/test')
5 files changed, 41 insertions, 14 deletions
diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java index e8c7b1af..360c36c9 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncARModelTest.java @@ -6,6 +6,7 @@ package org.onap.ccsdk.sli.northbound.uebclient; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; + import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncARModelTest { @@ -13,7 +14,8 @@ package org.onap.ccsdk.sli.northbound.uebclient; public void testSdncARModelConstructor() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); - SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + SdncARModel testSdncARModel = new SdncARModel(mockCsarHelper,nodeTemplate,mockDBResourceManager); assertNotNull(testSdncARModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java index 9df89fb2..d50c47a4 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncNodeModelTest.java @@ -8,6 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncNodeModelTest { @@ -17,7 +18,8 @@ public class SdncNodeModelTest { public void setUp() throws Exception { ISdcCsarHelper isdcCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate nodeTemplate = mock(NodeTemplate.class); - sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + sdncNodeModel = new SdncNodeModel(isdcCsarHelper, nodeTemplate, mockDBResourceManager); sdncNodeModel.setServiceUUID("0e8d757f-1c80-40af-85de-31d64f1f5af8"); sdncNodeModel.setEcompGeneratedNaming("hello-world"); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java index f03a09fc..a09c5a2b 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModelTest.java @@ -8,6 +8,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; public class SdncVFCModelTest { @@ -17,7 +18,8 @@ public class SdncVFCModelTest { public void setup() { ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); NodeTemplate mockNodeTemplate = mock(NodeTemplate.class); - testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate); + DBResourceManager mockDBResourceManager = mock(DBResourceManager.class); + testSdncVFCModel = new SdncVFCModel(mockCsarHelper, mockNodeTemplate, mockDBResourceManager); testSdncVFCModel.setVmType("Test-type"); testSdncVFCModel.setVmCount("5"); diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java index 881018ef..1fd10104 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFModuleModelTest.java @@ -6,6 +6,7 @@ import static org.mockito.Mockito.mock; import org.junit.Test; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; import org.onap.sdc.toscaparser.api.Group; +import org.onap.ccsdk.sli.northbound.uebclient.SdncVFModel; public class SdncVFModuleModelTest { @@ -13,7 +14,8 @@ public class SdncVFModuleModelTest { public void testSdncVFModuleModelConstructor() { Group mockGroup = mock(Group.class); ISdcCsarHelper mockCsarHelper = mock(ISdcCsarHelper.class); - SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup); + SdncVFModel mockSdncVFModel = mock(SdncVFModel.class); + SdncVFModuleModel testSdncVFModel = new SdncVFModuleModel(mockCsarHelper, mockGroup, mockSdncVFModel); assertNotNull(testSdncVFModel); } diff --git a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java index b53bdb39..d0a94d4b 100644 --- a/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java +++ b/ueb-listener/src/test/java/org/onap/ccsdk/sli/northbound/uebclient/TestSdncUebCallback.java @@ -214,18 +214,18 @@ public class TestSdncUebCallback { when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); mockProcessArtifact2 = mock(IArtifactInfo.class); - when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact2"); - when(mockProcessArtifact1.getArtifactType()).thenReturn("DG_XML"); - when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); - when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("456jhgt 1234ftg"); - when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + when(mockProcessArtifact2.getArtifactName()).thenReturn("mockProcessArtifact2"); + when(mockProcessArtifact2.getArtifactType()).thenReturn("DG_XML"); + when(mockProcessArtifact2.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact2.getArtifactChecksum()).thenReturn("456jhgt 1234ftg"); + when(mockProcessArtifact2.getArtifactTimeout()).thenReturn(110); mockProcessArtifact3 = mock(IArtifactInfo.class); - when(mockProcessArtifact1.getArtifactName()).thenReturn("mockProcessArtifact3"); - when(mockProcessArtifact1.getArtifactType()).thenReturn("HEAT"); - when(mockProcessArtifact1.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); - when(mockProcessArtifact1.getArtifactChecksum()).thenReturn("123tfg123 543gtd"); - when(mockProcessArtifact1.getArtifactTimeout()).thenReturn(110); + when(mockProcessArtifact3.getArtifactName()).thenReturn("mockProcessArtifact3"); + when(mockProcessArtifact3.getArtifactType()).thenReturn("HEAT"); + when(mockProcessArtifact3.getArtifactURL()).thenReturn("https://asdc.sdc.com/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml"); + when(mockProcessArtifact3.getArtifactChecksum()).thenReturn("123tfg123 543gtd"); + when(mockProcessArtifact3.getArtifactTimeout()).thenReturn(110); mockServiceArtifact1 = mock(IArtifactInfo.class); @@ -267,7 +267,16 @@ public class TestSdncUebCallback { cb.setJdbcDataSource(dblibSvc); INotificationData iData = mock(INotificationData.class); + /*IArtifactInfo iArtifactInfo = mock(IArtifactInfo.class); + when(iArtifactInfo.getArtifactName()).thenReturn("testArtifact1"); + when(iArtifactInfo.getArtifactType()).thenReturn("TOSCA_CSAR"); + List artifactInfoList = new ArrayList(); + artifactInfoList.add(iArtifactInfo);*/ + + when(iData.getServiceName()).thenReturn("testServiceName"); + //when(iData.getServiceArtifacts()).thenReturn(artifactInfoList); cb.activateCallback(iData); + } @@ -292,6 +301,16 @@ public class TestSdncUebCallback { when(mockData.getServiceName()).thenReturn("Test_service_name"); when(mockData.getServiceArtifacts()).thenReturn(processLevelArtifactList); + /*IArtifactInfo iArtifactInfo = mock(IArtifactInfo.class); + when(iArtifactInfo.getArtifactName()).thenReturn("testArtifact1"); + when(iArtifactInfo.getArtifactType()).thenReturn("TOSCA_CSAR"); + List artifactInfoList = new ArrayList(); + artifactInfoList.add(iArtifactInfo); + + //when(mockData.getServiceName()).thenReturn("testServiceName"); + when(mockData.getServiceArtifacts()).thenReturn(artifactInfoList);*/ + + SdncUebCallback cb1 = new SdncUebCallback(iDistClient1, config); cb1.activateCallback(mockData); assertTrue(true); |