use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.
the class BBInputSetupMapperLayerTest method testmapCatalogConfigurationToFabricConfiguration.
@Test
public void testmapCatalogConfigurationToFabricConfiguration() {
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);
CvnfcConfigurationCustomization fabricCustomization = new CvnfcConfigurationCustomization();
fabricCustomization.setCvnfcCustomization(new CvnfcCustomization());
fabricCustomization.getCvnfcCustomization().setVnfcCustomization(new VnfcCustomization());
fabricCustomization.setPolicyName(policyName);
fabricCustomization.setModelCustomizationUUID(modelCustUUID);
ConfigurationResource configurationResource = new ConfigurationResource();
configurationResource.setModelUUID(modelVersionUUID);
configurationResource.setModelInvariantUUID(modelInvariantUUID);
fabricCustomization.setConfigurationResource(configurationResource);
ModelInfoConfiguration actual = bbInputSetupMapperLayer.mapCatalogConfigurationToConfiguration(fabricCustomization);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.
the class BuildingBlockTestDataSetup method buildConfiguration.
public Configuration buildConfiguration() {
configurationCounter++;
Configuration configuration = new Configuration();
configuration.setConfigurationId("testConfigurationId" + configurationCounter);
configuration.setConfigurationName("testConfigurationName" + configurationCounter);
ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
modelInfoConfiguration.setModelVersionId("testModelVersionId" + configurationCounter);
modelInfoConfiguration.setModelInvariantId("testModelInvariantId" + configurationCounter);
modelInfoConfiguration.setModelCustomizationId("testModelCustomizationId" + configurationCounter);
configuration.setModelInfoConfiguration(modelInfoConfiguration);
return configuration;
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.
the class BBInputSetupMapperLayer method mapCatalogConfigurationToConfiguration.
protected ModelInfoConfiguration mapCatalogConfigurationToConfiguration(CvnfcConfigurationCustomization cvnfcConfigurationCustomization) {
ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
modelInfoConfiguration.setModelVersionId(cvnfcConfigurationCustomization.getConfigurationResource().getModelUUID());
modelInfoConfiguration.setModelCustomizationId(cvnfcConfigurationCustomization.getModelCustomizationUUID());
modelInfoConfiguration.setModelInvariantId(cvnfcConfigurationCustomization.getConfigurationResource().getModelInvariantUUID());
modelInfoConfiguration.setPolicyName(cvnfcConfigurationCustomization.getPolicyName());
modelInfoConfiguration.setConfigurationType(cvnfcConfigurationCustomization.getConfigurationType());
modelInfoConfiguration.setConfigurationRole(cvnfcConfigurationCustomization.getConfigurationRole());
return modelInfoConfiguration;
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.
the class AAIObjectMapperTest method mapConfigurationTest.
@Test
public void mapConfigurationTest() {
Configuration configuration = new Configuration();
configuration.setConfigurationId("configId");
configuration.setConfigurationName("VNR");
configuration.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
configuration.setManagementOption("managementOption");
ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
modelInfoConfiguration.setModelCustomizationId("modelCustId");
modelInfoConfiguration.setModelInvariantId("modelInvariantId");
modelInfoConfiguration.setModelVersionId("modelVersionId");
modelInfoConfiguration.setConfigurationType("5G");
modelInfoConfiguration.setConfigurationRole("ConfigurationRole");
configuration.setModelInfoConfiguration(modelInfoConfiguration);
org.onap.aai.domain.yang.Configuration expectedConfiguration = new org.onap.aai.domain.yang.Configuration();
expectedConfiguration.setConfigurationId(configuration.getConfigurationId());
expectedConfiguration.setConfigurationName(configuration.getConfigurationName());
expectedConfiguration.setConfigurationType(configuration.getModelInfoConfiguration().getConfigurationType());
expectedConfiguration.setOrchestrationStatus(configuration.getOrchestrationStatus().toString());
expectedConfiguration.setManagementOption(configuration.getManagementOption());
expectedConfiguration.setModelInvariantId(configuration.getModelInfoConfiguration().getModelInvariantId());
expectedConfiguration.setModelVersionId(configuration.getModelInfoConfiguration().getModelVersionId());
expectedConfiguration.setModelCustomizationId(configuration.getModelInfoConfiguration().getModelCustomizationId());
expectedConfiguration.setConfigurationSubType(configuration.getModelInfoConfiguration().getConfigurationRole());
expectedConfiguration.setConfigPolicyName(configuration.getModelInfoConfiguration().getPolicyName());
org.onap.aai.domain.yang.Configuration actualConfiguration = aaiObjectMapper.mapConfiguration(configuration);
assertThat(actualConfiguration, sameBeanAs(expectedConfiguration));
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.
the class BBInputSetupMapperLayer method mapCatalogConfigurationToConfiguration.
protected ModelInfoConfiguration mapCatalogConfigurationToConfiguration(ConfigurationResourceCustomization configurationResourceCustomization, CvnfcConfigurationCustomization cvnfcConfigurationCustomization) {
ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
modelInfoConfiguration.setModelVersionId(configurationResourceCustomization.getConfigurationResource().getModelUUID());
modelInfoConfiguration.setModelCustomizationId(configurationResourceCustomization.getModelCustomizationUUID());
modelInfoConfiguration.setModelInvariantId(configurationResourceCustomization.getConfigurationResource().getModelInvariantUUID());
modelInfoConfiguration.setConfigurationRole(configurationResourceCustomization.getRole());
modelInfoConfiguration.setConfigurationType(configurationResourceCustomization.getType());
if (cvnfcConfigurationCustomization != null) {
modelInfoConfiguration.setPolicyName(cvnfcConfigurationCustomization.getPolicyName());
}
return modelInfoConfiguration;
}
Aggregations