Search in sources :

Example 1 with ModelInfoConfiguration

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));
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) CvnfcCustomization(org.onap.so.db.catalog.beans.CvnfcCustomization) CvnfcConfigurationCustomization(org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization) VnfcCustomization(org.onap.so.db.catalog.beans.VnfcCustomization) ConfigurationResource(org.onap.so.db.catalog.beans.ConfigurationResource) Test(org.junit.Test)

Example 2 with ModelInfoConfiguration

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;
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration)

Example 3 with ModelInfoConfiguration

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;
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration)

Example 4 with 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));
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Test(org.junit.Test)

Example 5 with ModelInfoConfiguration

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;
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration)

Aggregations

ModelInfoConfiguration (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration)8 Test (org.junit.Test)4 Configuration (org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration)4 ConfigurationResource (org.onap.so.db.catalog.beans.ConfigurationResource)2 CvnfcConfigurationCustomization (org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization)2 CvnfcCustomization (org.onap.so.db.catalog.beans.CvnfcCustomization)2 VnfcCustomization (org.onap.so.db.catalog.beans.VnfcCustomization)2 GenericResourceApiConfigurationinformationConfigurationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation)1 ConfigurationResourceCustomization (org.onap.so.db.catalog.beans.ConfigurationResourceCustomization)1