Search in sources :

Example 16 with VnfResourceCustomization

use of org.onap.so.db.catalog.beans.VnfResourceCustomization in project so by onap.

the class CatalogDbClientTest method testGetVnfResourceCustomizationByModelCustomizationUUINotFound.

@Test
public void testGetVnfResourceCustomizationByModelCustomizationUUINotFound() {
    VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
    assertNull(vnfResourceCustomization);
}
Also used : VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 17 with VnfResourceCustomization

use of org.onap.so.db.catalog.beans.VnfResourceCustomization in project so by onap.

the class CatalogDbClientTest method testGetVnfResourceCustomizationByModelCustomizationUUID.

@Test
public void testGetVnfResourceCustomizationByModelCustomizationUUID() {
    VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
    assertNotNull(vnfResourceCustomization);
    assertEquals("vSAMP", vnfResourceCustomization.getNfRole());
    assertNotNull(vnfResourceCustomization.getModelCustomizationUUID());
    assertNotNull(vnfResourceCustomization.getVnfResources());
    assertNotNull(vnfResourceCustomization.getVfModuleCustomizations());
    assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName());
    assertFalse("skip post instantiation configuration", vnfResourceCustomization.getSkipPostInstConf().booleanValue());
}
Also used : VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 18 with VnfResourceCustomization

use of org.onap.so.db.catalog.beans.VnfResourceCustomization in project so by onap.

the class CatalogDbClientTest method testGetFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources.

@Test
public void testGetFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources() {
    VnfResource vnfr = new VnfResource();
    vnfr.setModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
    VnfResourceCustomization firstVnfResourceCustomizationByModelInstanceNameAndVnfResources = client.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources("vSAMP10a 1", vnfr);
    assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources);
    assertEquals("vSAMP", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getNfRole());
    assertEquals("vSAMP10a 1", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getModelInstanceName());
    assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVnfResources());
    assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
}
Also used : VnfResource(org.onap.so.db.catalog.beans.VnfResource) VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 19 with VnfResourceCustomization

use of org.onap.so.db.catalog.beans.VnfResourceCustomization in project so by onap.

the class WorkflowActionBBTasksTest method selectBBTest.

@Test
public void selectBBTest() {
    String vnfCustomizationUUID = "1234567";
    String modelUuid = "1234567";
    prepareDelegateExecution();
    List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
    BuildingBlock buildingBlock = new BuildingBlock().setBpmnFlowName("ConfigAssignVnfBB").setKey(vnfCustomizationUUID);
    RequestDetails rd = new RequestDetails();
    ModelInfo mi = new ModelInfo();
    mi.setModelUuid(modelUuid);
    rd.setModelInfo(mi);
    ExecuteBuildingBlock ebb = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock).setRequestDetails(rd);
    flowsToExecute.add(ebb);
    List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
    VnfResourceCustomization vrc = new VnfResourceCustomization();
    vrc.setSkipPostInstConf(false);
    vrc.setModelCustomizationUUID(vnfCustomizationUUID);
    vnfResourceCustomizations.add(vrc);
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setModelCustomizationId(vnfCustomizationUUID);
    doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid);
    doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations);
    execution.setVariable("flowsToExecute", flowsToExecute);
    workflowActionBBTasks.selectBB(execution);
    boolean success = (boolean) execution.getVariable("completed");
    int currentSequence = (int) execution.getVariable("gCurrentSequence");
    assertFalse(success);
    assertEquals(1, currentSequence);
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) BuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock) GenericVnf(org.onap.aai.domain.yang.GenericVnf) ArrayList(java.util.ArrayList) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) RequestDetails(org.onap.so.serviceinstancebeans.RequestDetails) VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 20 with VnfResourceCustomization

use of org.onap.so.db.catalog.beans.VnfResourceCustomization in project so by onap.

the class SkipConfigVnfListenerTest method createVnfResourceCustomization.

private VnfResourceCustomization createVnfResourceCustomization() {
    VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization();
    vnfResourceCustomization.setSkipPostInstConf(true);
    return vnfResourceCustomization;
}
Also used : VnfResourceCustomization(org.onap.so.db.catalog.beans.VnfResourceCustomization)

Aggregations

VnfResourceCustomization (org.onap.so.db.catalog.beans.VnfResourceCustomization)43 Test (org.junit.Test)23 ArrayList (java.util.ArrayList)17 Service (org.onap.so.db.catalog.beans.Service)15 VfModuleCustomization (org.onap.so.db.catalog.beans.VfModuleCustomization)13 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)11 VnfResource (org.onap.so.db.catalog.beans.VnfResource)10 VfModule (org.onap.so.db.catalog.beans.VfModule)7 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)7 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)6 PnfResourceCustomization (org.onap.so.db.catalog.beans.PnfResourceCustomization)6 Transactional (org.springframework.transaction.annotation.Transactional)6 List (java.util.List)5 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)5 VnfcInstanceGroupCustomization (org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 BuildingBlockExecution (org.onap.so.bpmn.common.BuildingBlockExecution)4 Resource (org.onap.so.bpmn.infrastructure.workflow.tasks.Resource)4 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)4 NetworkResourceCustomization (org.onap.so.db.catalog.beans.NetworkResourceCustomization)4