summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-12 00:54:52 +0300
committerMichael Lando <ml636r@att.com>2017-07-12 01:55:12 +0300
commitdd60339b06d252fcb1382aa97ab3d65b37dad021 (patch)
treec1551ce67cd77ca810ad5f579eb3617af86be85f /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test
parentab146a193c43e9be0e9efeac7bab2690a7ba2d33 (diff)
[sdc] rebase update
Change-Id: I8f1fc7150975122dd9f3f4e653b9983064b399a6 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java29
1 files changed, 23 insertions, 6 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
index 540df7d5ed..5a2f76b6fa 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
@@ -56,9 +56,11 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.EnrichmentManagerFactoryImpl;
import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactGenerator;
@@ -284,7 +286,7 @@ public class VendorSoftwareProductManagerImplTest {
assertVspsEquals(vsp, vspToCreate);
verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
- Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor()+1));
+ Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
Assert.assertTrue(activityLogEntity.isSuccess());
}
@@ -409,7 +411,7 @@ public class VendorSoftwareProductManagerImplTest {
USER1, null);
verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
- Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor()+1));
+ Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
Assert.assertTrue(activityLogEntity.isSuccess());
}
@@ -427,7 +429,7 @@ public class VendorSoftwareProductManagerImplTest {
verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
- Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor()+1));
+ Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
Assert.assertTrue(activityLogEntity.isSuccess());
}
@@ -459,6 +461,7 @@ public class VendorSoftwareProductManagerImplTest {
public void testSubmitWithMissingData() throws IOException {
VersionInfo versionInfo = new VersionInfo();
versionInfo.setActiveVersion(VERSION01);
+
doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
VSP_ID, USER1, VersionableEntityAction.Read);
@@ -466,6 +469,20 @@ public class VendorSoftwareProductManagerImplTest {
VspDetails vsp = new VspDetails(VSP_ID, VERSION01);
doReturn(vsp).when(vspInfoDaoMock).get(anyObject());
+ VspQuestionnaireEntity vspQuestionnaire = new VspQuestionnaireEntity(VSP_ID, VERSION01);
+ vspQuestionnaire.setQuestionnaireData("{}");
+ doReturn(vspQuestionnaire).when(vspInfoDaoMock).getQuestionnaire(VSP_ID, VERSION01);
+
+ ComponentEntity comp1 = new ComponentEntity(VSP_ID, VERSION01, "comp1");
+ comp1.setQuestionnaireData("{}");
+ doReturn(Collections.singleton(comp1)).when(vendorSoftwareProductDaoMock)
+ .listComponentsCompositionAndQuestionnaire(VSP_ID, VERSION01);
+
+ NicEntity nic1 = new NicEntity(VSP_ID, VERSION01, "comp1", "nic1");
+ nic1.setQuestionnaireData("{}");
+ doReturn(Collections.singleton(nic1))
+ .when(vendorSoftwareProductDaoMock).listNicsByVsp(VSP_ID, VERSION01);
+
ValidationResponse validationResponse = vendorSoftwareProductManager.submit(VSP_ID, USER1);
Assert.assertNotNull(validationResponse);
Assert.assertFalse(validationResponse.isValid());
@@ -477,7 +494,7 @@ public class VendorSoftwareProductManagerImplTest {
verify(versioningManagerMock, never())
.submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
USER1, null);
- verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class),eq(USER1));
+ verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class), eq(USER1));
}
// TODO: 3/15/2017 fix and enable
@@ -549,7 +566,7 @@ public class VendorSoftwareProductManagerImplTest {
verify(versioningManagerMock)
.submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
USER1, null);
- verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(),eq(USER1));
+ verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION10.getMajor()));
Assert.assertTrue(activityLogEntity.isSuccess());
@@ -612,7 +629,7 @@ public class VendorSoftwareProductManagerImplTest {
Assert.assertEquals(ce.getMessage(), Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage());
}
- verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class),eq(USER1));
+ verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class), eq(USER1));
}
/*
@Test