Search in sources :

Example 6 with ModelInfoConfiguration

use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.

the class GeneralTopologyObjectMapperTest method buildConfigurationInformationTest_includesOnapModelInfo.

@Test
public void buildConfigurationInformationTest_includesOnapModelInfo() {
    Configuration configuration = new Configuration();
    configuration.setConfigurationId("testConfigurationId");
    configuration.setConfigurationType("VNR");
    configuration.setConfigurationName("VNRCONF");
    ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
    modelInfoConfiguration.setModelVersionId("modelVersionId");
    modelInfoConfiguration.setModelInvariantId("modelInvariantId");
    modelInfoConfiguration.setModelCustomizationId("modelCustomizationId");
    configuration.setModelInfoConfiguration(modelInfoConfiguration);
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = genObjMapper.buildConfigurationInformation(configuration, true);
    assertEquals(configuration.getConfigurationId(), configurationInformation.getConfigurationId());
    assertEquals(configuration.getConfigurationType(), configurationInformation.getConfigurationType());
    assertEquals(configuration.getConfigurationName(), configurationInformation.getConfigurationName());
    assertNotNull(configurationInformation.getOnapModelInformation());
    assertEquals(configuration.getModelInfoConfiguration().getModelVersionId(), configurationInformation.getOnapModelInformation().getModelUuid());
    assertEquals(configuration.getModelInfoConfiguration().getModelInvariantId(), configurationInformation.getOnapModelInformation().getModelInvariantUuid());
    assertEquals(configuration.getModelInfoConfiguration().getModelCustomizationId(), configurationInformation.getOnapModelInformation().getModelCustomizationUuid());
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Test(org.junit.Test)

Example 7 with ModelInfoConfiguration

use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration 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));
}
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) ConfigurationResourceCustomization(org.onap.so.db.catalog.beans.ConfigurationResourceCustomization) Test(org.junit.Test)

Example 8 with ModelInfoConfiguration

use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration in project so by onap.

the class TestDataSetup 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)

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