Search in sources :

Example 16 with ModelInfoVfModule

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

the class BBInputSetupMapperLayer method mapAAIVfModule.

protected VfModule mapAAIVfModule(org.onap.aai.domain.yang.VfModule aaiVfModule) {
    VfModule vfModule = modelMapper.map(aaiVfModule, VfModule.class);
    vfModule.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiVfModule.getOrchestrationStatus()));
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setIsBaseBoolean(aaiVfModule.isIsBaseVfModule());
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    return vfModule;
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule)

Example 17 with ModelInfoVfModule

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

the class AAIObjectMapperTest method vfModuleMap.

@Test
public void vfModuleMap() throws Exception {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("a");
    vfModule.setVfModuleName("b");
    vfModule.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelCustomizationUUID("f");
    modelInfoVfModule.setModelInvariantUUID("g");
    modelInfoVfModule.setModelUUID("h");
    modelInfoVfModule.setIsBaseBoolean(false);
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    org.onap.aai.domain.yang.VfModule AAIVfModule = aaiObjectMapper.mapVfModule(vfModule);
    String jsonToCompare = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVfModuleMap.json")));
    ObjectMapper omapper = new ObjectMapper();
    org.onap.aai.domain.yang.VfModule reqMapper1 = omapper.readValue(jsonToCompare, org.onap.aai.domain.yang.VfModule.class);
    assertThat(reqMapper1, sameBeanAs(AAIVfModule));
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 18 with ModelInfoVfModule

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

the class AAIObjectMapperTest method vfModuleBaseMap.

@Test
public void vfModuleBaseMap() throws Exception {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("a");
    vfModule.setVfModuleName("b");
    vfModule.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelCustomizationUUID("f");
    modelInfoVfModule.setModelInvariantUUID("g");
    modelInfoVfModule.setModelUUID("h");
    modelInfoVfModule.setIsBaseBoolean(true);
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    org.onap.aai.domain.yang.VfModule AAIVfModule = aaiObjectMapper.mapVfModule(vfModule);
    String jsonToCompare = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVfModuleBaseMap.json")));
    ObjectMapper omapper = new ObjectMapper();
    org.onap.aai.domain.yang.VfModule reqMapper1 = omapper.readValue(jsonToCompare, org.onap.aai.domain.yang.VfModule.class);
    assertThat(reqMapper1, sameBeanAs(AAIVfModule));
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 19 with ModelInfoVfModule

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

the class AAIObjectMapperTest method mapVolumeGroupTest.

@Test
public void mapVolumeGroupTest() throws Exception {
    VolumeGroup volumeGroup = new VolumeGroup();
    volumeGroup.setHeatStackId("heatStackId");
    volumeGroup.setModelInfoVfModule(new ModelInfoVfModule());
    volumeGroup.getModelInfoVfModule().setModelCustomizationUUID("modelCustomizationId");
    volumeGroup.setOrchestrationStatus(OrchestrationStatus.ACTIVE);
    volumeGroup.setVnfType("vnfType");
    volumeGroup.setVolumeGroupId("volumeGroupId");
    volumeGroup.setVolumeGroupName("volumeGroupName");
    org.onap.aai.domain.yang.VolumeGroup expectedVolumeGroup = new org.onap.aai.domain.yang.VolumeGroup();
    expectedVolumeGroup.setHeatStackId(volumeGroup.getHeatStackId());
    expectedVolumeGroup.setModelCustomizationId(volumeGroup.getModelInfoVfModule().getModelCustomizationUUID());
    expectedVolumeGroup.setOrchestrationStatus(volumeGroup.getOrchestrationStatus().toString());
    expectedVolumeGroup.setVfModuleModelCustomizationId(volumeGroup.getModelInfoVfModule().getModelCustomizationUUID());
    expectedVolumeGroup.setVnfType(volumeGroup.getVnfType());
    expectedVolumeGroup.setVolumeGroupId(volumeGroup.getVolumeGroupId());
    expectedVolumeGroup.setVolumeGroupName(volumeGroup.getVolumeGroupName());
    org.onap.aai.domain.yang.VolumeGroup actualVolumeGroup = aaiObjectMapper.mapVolumeGroup(volumeGroup);
    assertThat(actualVolumeGroup, sameBeanAs(expectedVolumeGroup));
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VolumeGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup) Test(org.junit.Test)

Example 20 with ModelInfoVfModule

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

the class BBInputSetupMapperLayer method mapCatalogVfModuleToVfModule.

protected ModelInfoVfModule mapCatalogVfModuleToVfModule(VfModuleCustomization vfResourceCustomization) {
    ModelInfoVfModule modelInfoVfModule = modelMapper.map(vfResourceCustomization, ModelInfoVfModule.class);
    modelMapper.map(vfResourceCustomization.getVfModule(), modelInfoVfModule);
    return modelInfoVfModule;
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule)

Aggregations

ModelInfoVfModule (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule)33 Test (org.junit.Test)27 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)25 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)20 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)18 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)18 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)17 HashMap (java.util.HashMap)16 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)16 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)16 OrchestrationContext (org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)13 CreateVfModuleRequest (org.onap.so.adapters.vnfrest.CreateVfModuleRequest)10 VolumeGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup)8 RequestParameters (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters)4 Service (org.onap.so.db.catalog.beans.Service)4 VfModuleCustomization (org.onap.so.db.catalog.beans.VfModuleCustomization)4 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 URI (java.net.URI)3 ArrayList (java.util.ArrayList)3