use of org.onap.so.db.catalog.beans.VfModuleCustomization in project so by onap.
the class ToscaResourceStructureTest method toscaResourceStructureBeanTest.
@Test
public void toscaResourceStructureBeanTest() {
artifactInfo = mock(ArtifactInfoImpl.class);
sdcCsarHelper = mock(SdcCsarHelperImpl.class);
toscaResourceStructure = new ToscaResourceStructure();
toscaResourceStructure.setHeatTemplateUUID("heatTemplateUUID");
toscaResourceStructure.setAllottedList(new ArrayList<NodeTemplate>());
toscaResourceStructure.setSdcCsarHelper(sdcCsarHelper);
toscaResourceStructure.setServiceMetadata(new Metadata(new HashMap<>()));
toscaResourceStructure.setCatalogService(new Service());
toscaResourceStructure.setNetworkTypes(new ArrayList<>());
toscaResourceStructure.setVfTypes(new ArrayList<>());
toscaResourceStructure.setCatalogResourceCustomization(new AllottedResourceCustomization());
toscaResourceStructure.setCatalogNetworkResourceCustomization(new NetworkResourceCustomization());
toscaResourceStructure.setCatalogNetworkResource(new NetworkResource());
toscaResourceStructure.setCatalogVfModule(new VfModule());
toscaResourceStructure.setVnfResourceCustomization(new VnfResourceCustomization());
toscaResourceStructure.setVfModuleCustomization(new VfModuleCustomization());
toscaResourceStructure.setAllottedResource(new AllottedResource());
toscaResourceStructure.setAllottedResourceCustomization(new AllottedResourceCustomization());
toscaResourceStructure.setCatalogTempNetworkHeatTemplateLookup(new TempNetworkHeatTemplateLookup());
toscaResourceStructure.setHeatFilesUUID("heatFilesUUID");
toscaResourceStructure.setToscaArtifact(artifactInfo);
toscaResourceStructure.setToscaCsar(new ToscaCsar());
toscaResourceStructure.setVolHeatTemplateUUID("volHeatTemplateUUID");
toscaResourceStructure.setEnvHeatTemplateUUID("envHeatTemplateUUID");
toscaResourceStructure.setServiceVersion("serviceVersion");
toscaResourceStructure.setWorkloadPerformance("workloadPerformance");
toscaResourceStructure.setVfModule(new VfModule());
toscaResourceStructure.setTempNetworkHeatTemplateLookup(new TempNetworkHeatTemplateLookup());
toscaResourceStructure.setSuccessfulDeployment();
assertEquals("heatTemplateUUID", toscaResourceStructure.getHeatTemplateUUID());
assertThat(toscaResourceStructure.getAllottedList(), sameBeanAs(new ArrayList<NodeTemplate>()));
assertEquals(sdcCsarHelper, toscaResourceStructure.getSdcCsarHelper());
assertThat(toscaResourceStructure.getServiceMetadata(), sameBeanAs(new Metadata(new HashMap<>())));
assertThat(toscaResourceStructure.getCatalogService(), sameBeanAs(new Service()));
assertThat(toscaResourceStructure.getNetworkTypes(), sameBeanAs(new ArrayList<>()));
assertThat(toscaResourceStructure.getVfTypes(), sameBeanAs(new ArrayList<>()));
assertThat(toscaResourceStructure.getCatalogResourceCustomization(), sameBeanAs(new AllottedResourceCustomization()));
assertThat(toscaResourceStructure.getCatalogNetworkResourceCustomization(), sameBeanAs(new NetworkResourceCustomization()));
assertThat(toscaResourceStructure.getCatalogNetworkResource(), sameBeanAs(new NetworkResource()));
assertThat(toscaResourceStructure.getCatalogVfModule(), sameBeanAs(new VfModule()));
assertThat(toscaResourceStructure.getVnfResourceCustomization(), sameBeanAs(new VnfResourceCustomization()));
assertThat(toscaResourceStructure.getVfModuleCustomization(), sameBeanAs(new VfModuleCustomization()));
assertThat(toscaResourceStructure.getAllottedResource(), sameBeanAs(new AllottedResource()));
assertThat(toscaResourceStructure.getAllottedResourceCustomization(), sameBeanAs(new AllottedResourceCustomization()));
assertThat(toscaResourceStructure.getCatalogTempNetworkHeatTemplateLookup(), sameBeanAs(new TempNetworkHeatTemplateLookup()));
assertEquals("heatFilesUUID", toscaResourceStructure.getHeatFilesUUID());
assertEquals(artifactInfo, toscaResourceStructure.getToscaArtifact());
assertThat(toscaResourceStructure.getToscaCsar(), sameBeanAs(new ToscaCsar()));
assertEquals("volHeatTemplateUUID", toscaResourceStructure.getVolHeatTemplateUUID());
assertEquals("envHeatTemplateUUID", toscaResourceStructure.getEnvHeatTemplateUUID());
assertEquals("serviceVersion", toscaResourceStructure.getServiceVersion());
assertEquals("workloadPerformance", toscaResourceStructure.getWorkloadPerformance());
assertThat(toscaResourceStructure.getVfModule(), sameBeanAs(new VfModule()));
assertThat(toscaResourceStructure.getTempNetworkHeatTemplateLookup(), sameBeanAs(new TempNetworkHeatTemplateLookup()));
assertEquals(true, toscaResourceStructure.isDeployedSuccessfully());
}
use of org.onap.so.db.catalog.beans.VfModuleCustomization in project so by onap.
the class BBInputSetupTest method testMapCatalogVfModule.
@Test
public void testMapCatalogVfModule() {
String vnfModelCustomizationUUID = "vnfResourceCustUUID";
String vfModuleCustomizationUUID = "vfModelCustomizationUUID";
VfModule vfModule = new VfModule();
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationUuid(vfModuleCustomizationUUID);
Service service = new Service();
VnfResourceCustomization vnfResourceCust = new VnfResourceCustomization();
vnfResourceCust.setModelCustomizationUUID(vnfModelCustomizationUUID);
VfModuleCustomization vfModuleCust = new VfModuleCustomization();
vfModuleCust.setModelCustomizationUUID(vfModuleCustomizationUUID);
vnfResourceCust.getVfModuleCustomizations().add(vfModuleCust);
service.getVnfCustomizations().add(vnfResourceCust);
ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
doReturn(modelInfoVfModule).when(bbInputSetupMapperLayer).mapCatalogVfModuleToVfModule(vfModuleCust);
SPY_bbInputSetup.mapCatalogVfModule(vfModule, modelInfo, service, vnfModelCustomizationUUID);
assertThat(vfModule.getModelInfoVfModule(), sameBeanAs(modelInfoVfModule));
modelInfo.setModelCustomizationUuid(null);
modelInfo.setModelCustomizationId(vfModuleCustomizationUUID);
SPY_bbInputSetup.mapCatalogVfModule(vfModule, modelInfo, service, vnfModelCustomizationUUID);
assertThat(vfModule.getModelInfoVfModule(), sameBeanAs(modelInfoVfModule));
}
Aggregations