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);
}
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());
}
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());
}
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);
}
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;
}
Aggregations