use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class CatalogDbClientTest method testFindCvnfcCustomizationInListNoNulls.
@Test
public final void testFindCvnfcCustomizationInListNoNulls() {
String cvnfcCustomizationUuid = "a123";
CvnfcCustomization cvnfc = new CvnfcCustomization();
cvnfc.setModelCustomizationUUID("z789J");
CvnfcCustomization cvnfc2 = new CvnfcCustomization();
cvnfc2.setModelCustomizationUUID("a123");
ArrayList<CvnfcCustomization> cvnfcs = new ArrayList<CvnfcCustomization>();
cvnfcs.add(cvnfc);
cvnfcs.add(cvnfc2);
CvnfcCustomization aCvnfc = catalogDbClient.findCvnfcCustomizationInAList(cvnfcCustomizationUuid, cvnfcs);
assertTrue(aCvnfc.getModelCustomizationUUID().equals("a123"));
}
use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class WorkflowActionTest method selectExecutionListALaCarteVfModuleFabricCreateTest.
@Test
public void selectExecutionListALaCarteVfModuleFabricCreateTest() throws Exception {
String gAction = "createInstance";
String resource = "VfModule";
String bpmnRequest = readBpmnRequestFromFile(VF_MODULE_CREATE_WITH_FABRIC_JSON);
initExecution(gAction, bpmnRequest, true);
execution.setVariable("requestUri", "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "AddFabricConfigurationBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
List<CvnfcCustomization> cvnfcCustomizations = new ArrayList<CvnfcCustomization>();
CvnfcCustomization cvnfcCustomization = new CvnfcCustomization();
CvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new CvnfcConfigurationCustomization();
ConfigurationResource configurationResource = new ConfigurationResource();
configurationResource.setToscaNodeType("FabricConfiguration");
vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource);
vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName1");
vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization);
List<CvnfcConfigurationCustomization> custSet = new ArrayList<CvnfcConfigurationCustomization>();
custSet.add(vnfVfmoduleCvnfcConfigurationCustomization);
cvnfcCustomization.setCvnfcConfigurationCustomization(custSet);
cvnfcCustomization.setDescription("description");
cvnfcCustomizations.add(cvnfcCustomization);
CvnfcCustomization cvnfcCustomization2 = new CvnfcCustomization();
CvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization2 = new CvnfcConfigurationCustomization();
ConfigurationResource configurationResource2 = new ConfigurationResource();
configurationResource2.setToscaNodeType("FabricConfiguration");
vnfVfmoduleCvnfcConfigurationCustomization2.setConfigurationResource(configurationResource2);
vnfVfmoduleCvnfcConfigurationCustomization2.setModelInstanceName("modelInstanceName2");
vnfVfmoduleCvnfcConfigurationCustomization2.setCvnfcCustomization(cvnfcCustomization2);
List<CvnfcConfigurationCustomization> custSet2 = new ArrayList<CvnfcConfigurationCustomization>();
custSet2.add(vnfVfmoduleCvnfcConfigurationCustomization2);
cvnfcCustomization2.setCvnfcConfigurationCustomization(custSet2);
cvnfcCustomization2.setDescription("description2");
cvnfcCustomizations.add(cvnfcCustomization2);
when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, true, "my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB");
}
use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class WorkflowActionUnitTest method traverseCatalogDbForConfigurationTest.
@Test
public void traverseCatalogDbForConfigurationTest() {
CvnfcCustomization cvnfcCustomization = new CvnfcCustomization();
CvnfcConfigurationCustomization vfModuleCustomization = new CvnfcConfigurationCustomization();
ConfigurationResource configuration = new ConfigurationResource();
configuration.setToscaNodeType("FabricConfiguration");
configuration.setModelUUID("my-uuid");
vfModuleCustomization.setConfigurationResource(configuration);
cvnfcCustomization.setCvnfcConfigurationCustomization(Collections.singletonList(vfModuleCustomization));
List<CvnfcCustomization> cvnfcCustomizations = Arrays.asList(cvnfcCustomization);
// when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(any(String.class),
// any(String.class)))
// .thenReturn(cvnfcCustomizations);
// List<CvnfcConfigurationCustomization> results =
// workflowAction.traverseCatalogDbForConfiguration("myVnfCustomizationId", "myVfModuleCustomizationId");
// assertThat(results, is(Arrays.asList(vfModuleCustomization)));
}
use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class UserParamsServiceTraversalTest method getCvnfcCustomizations.
private List<CvnfcCustomization> getCvnfcCustomizations() {
ConfigurationResource configurationResource = new ConfigurationResource();
configurationResource.setToscaNodeType("FabricConfiguration");
CvnfcConfigurationCustomization cvnfcConfigurationCustomization = new CvnfcConfigurationCustomization();
cvnfcConfigurationCustomization.setConfigurationResource(configurationResource);
CvnfcCustomization cvnfcCustomization = new CvnfcCustomization();
List<CvnfcConfigurationCustomization> cvnfcConfigurationCustomizations = new ArrayList<>();
cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization);
cvnfcCustomization.setCvnfcConfigurationCustomization(cvnfcConfigurationCustomizations);
List<CvnfcCustomization> cvnfcCustomizations = new ArrayList<>();
cvnfcCustomizations.add(cvnfcCustomization);
return cvnfcCustomizations;
}
use of org.onap.so.db.catalog.beans.CvnfcCustomization in project so by onap.
the class BBInputSetupMapperLayerTest method testmapCatalogConfigurationToConfiguration.
@Test
public void testmapCatalogConfigurationToConfiguration() {
String modelCustUUID = "modelCustomizationUUID";
String modelInvariantUUID = "modelInvariantUUID";
String modelVersionUUID = "modelUUID";
String policyName = "policyName";
ModelInfoConfiguration expected = new ModelInfoConfiguration();
expected.setModelCustomizationId(modelCustUUID);
expected.setModelInvariantId(modelInvariantUUID);
expected.setModelVersionId(modelVersionUUID);
expected.setPolicyName(policyName);
ConfigurationResourceCustomization configurationResourceCustomization = new ConfigurationResourceCustomization();
configurationResourceCustomization.setModelCustomizationUUID(modelCustUUID);
configurationResourceCustomization.setConfigurationResource(new ConfigurationResource());
configurationResourceCustomization.getConfigurationResource().setModelInvariantUUID(modelInvariantUUID);
configurationResourceCustomization.getConfigurationResource().setModelUUID(modelVersionUUID);
CvnfcConfigurationCustomization policyNameTable = new CvnfcConfigurationCustomization();
policyNameTable.setCvnfcCustomization(new CvnfcCustomization());
policyNameTable.getCvnfcCustomization().setVnfcCustomization(new VnfcCustomization());
policyNameTable.setPolicyName(policyName);
ModelInfoConfiguration actual = bbInputSetupMapperLayer.mapCatalogConfigurationToConfiguration(configurationResourceCustomization, policyNameTable);
assertThat(actual, sameBeanAs(expected));
}
Aggregations