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;
}
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));
}
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));
}
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));
}
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;
}
Aggregations