Search in sources :

Example 56 with VfModuleCustomization

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());
}
Also used : ArtifactInfoImpl(org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl) HashMap(java.util.HashMap) Metadata(org.onap.sdc.toscaparser.api.elements.Metadata) ArrayList(java.util.ArrayList) Service(org.onap.so.db.catalog.beans.Service) VfModule(org.onap.so.db.catalog.beans.VfModule) AllottedResource(org.onap.so.db.catalog.beans.AllottedResource) AllottedResourceCustomization(org.onap.so.db.catalog.beans.AllottedResourceCustomization) NetworkResource(org.onap.so.db.catalog.beans.NetworkResource) NodeTemplate(org.onap.sdc.toscaparser.api.NodeTemplate) TempNetworkHeatTemplateLookup(org.onap.so.db.catalog.beans.TempNetworkHeatTemplateLookup) SdcCsarHelperImpl(org.onap.sdc.tosca.parser.impl.SdcCsarHelperImpl) NetworkResourceCustomization(org.onap.so.db.catalog.beans.NetworkResourceCustomization) VfModuleCustomization(org.onap.so.db.catalog.beans.VfModuleCustomization) ToscaCsar(org.onap.so.db.catalog.beans.ToscaCsar) VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) Test(org.junit.Test)

Example 57 with VfModuleCustomization

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));
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) Service(org.onap.so.db.catalog.beans.Service) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModuleCustomization(org.onap.so.db.catalog.beans.VfModuleCustomization) VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) Test(org.junit.Test)

Aggregations

VfModuleCustomization (org.onap.so.db.catalog.beans.VfModuleCustomization)57 Test (org.junit.Test)35 ArrayList (java.util.ArrayList)29 HeatEnvironment (org.onap.so.db.catalog.beans.HeatEnvironment)23 HeatTemplate (org.onap.so.db.catalog.beans.HeatTemplate)23 VfModule (org.onap.so.db.catalog.beans.VfModule)20 List (java.util.List)15 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)14 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)13 VnfResourceCustomization (org.onap.so.db.catalog.beans.VnfResourceCustomization)13 HashMap (java.util.HashMap)12 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)12 ArgumentMatchers.anyList (org.mockito.ArgumentMatchers.anyList)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)12 RelationshipList (org.onap.aai.domain.yang.RelationshipList)12 VfModule (org.onap.aai.domain.yang.VfModule)12 NorthBoundRequest (org.onap.so.db.catalog.beans.macro.NorthBoundRequest)12 Service (org.onap.so.db.catalog.beans.Service)11 VnfResource (org.onap.so.db.catalog.beans.VnfResource)10 Map (java.util.Map)7