Search in sources :

Example 21 with ModelInfoVfModule

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

the class BBInputSetupMapperLayer method mapAAIVolumeGroup.

protected VolumeGroup mapAAIVolumeGroup(org.onap.aai.domain.yang.VolumeGroup aaiVolumeGroup) {
    VolumeGroup volumeGroup = modelMapper.map(aaiVolumeGroup, VolumeGroup.class);
    ModelInfoVfModule modelInfo = new ModelInfoVfModule();
    modelInfo.setModelCustomizationUUID(aaiVolumeGroup.getModelCustomizationId());
    volumeGroup.setModelInfoVfModule(modelInfo);
    volumeGroup.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiVolumeGroup.getOrchestrationStatus()));
    return volumeGroup;
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VolumeGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup)

Example 22 with ModelInfoVfModule

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

the class VfModuleTopologyOperationRequestMapperTest method assignGenericResourceApiVfModuleInformationTest.

@Test
public void assignGenericResourceApiVfModuleInformationTest() throws Exception {
    // prepare and set service instance
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
    modelInfoServiceInstance.setModelInvariantUuid("serviceModelInvariantUuid");
    modelInfoServiceInstance.setModelName("serviceModelName");
    modelInfoServiceInstance.setModelUuid("serviceModelUuid");
    modelInfoServiceInstance.setModelVersion("serviceModelVersion");
    serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
    // prepare Customer object
    Customer customer = new Customer();
    customer.setGlobalCustomerId("globalCustomerId");
    ServiceSubscription serviceSubscription = new ServiceSubscription();
    serviceSubscription.setServiceType("productFamilyId");
    customer.setServiceSubscription(serviceSubscription);
    customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
    // 
    RequestContext requestContext = new RequestContext();
    Map<String, Object> userParams = new HashMap<>();
    userParams.put("key1", "value1");
    requestContext.setUserParams(userParams);
    requestContext.setProductFamilyId("productFamilyId");
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setUsePreload(true);
    requestContext.setRequestParameters(requestParameters);
    requestContext.setMsoRequestId("MsoRequestId");
    GenericVnf vnf = new GenericVnf();
    vnf.setVnfId("testVnfId");
    vnf.setVnfType("testVnfType");
    vnf.setVnfName("testVnfName");
    ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
    modelInfoGenericVnf.setModelInvariantUuid("vnfModelInvariantUuid");
    modelInfoGenericVnf.setModelName("vnfModelName");
    modelInfoGenericVnf.setModelVersion("vnfModelVersion");
    modelInfoGenericVnf.setModelUuid("vnfModelUuid");
    modelInfoGenericVnf.setModelCustomizationUuid("vnfModelCustomizationUuid");
    vnf.setModelInfoGenericVnf(modelInfoGenericVnf);
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("testVfModuleId");
    vfModule.setVfModuleName("testVfModuleName");
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelInvariantUUID("vfModuleModelInvariantUuid");
    modelInfoVfModule.setModelName("vfModuleModelName");
    modelInfoVfModule.setModelVersion("vfModuleModelVersion");
    modelInfoVfModule.setModelUUID("vfModuleModelUuid");
    modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    HashMap<String, String> cloudParams = new HashMap<String, String>();
    cloudParams.put("key2", "value2");
    vfModule.setCloudParams(cloudParams);
    VolumeGroup volumeGroup = new VolumeGroup();
    volumeGroup.setVolumeGroupId("volumeGroupId");
    volumeGroup.setVolumeGroupName("volumeGroupName");
    CloudRegion cloudRegion = new CloudRegion();
    GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, vfModule, volumeGroup, vnf, serviceInstance, customer, cloudRegion, requestContext, null, new URI("http://localhost:8080"));
    String jsonToCompare = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "genericResourceApiVfModuleOperationInformationAssign.json")));
    ObjectMapper omapper = new ObjectMapper();
    GenericResourceApiVfModuleOperationInformation reqMapper1 = omapper.readValue(jsonToCompare, GenericResourceApiVfModuleOperationInformation.class);
    assertThat(vfModuleSDNCrequest, sameBeanAs(reqMapper1).ignoring("sdncRequestHeader.svcRequestId").ignoring("requestInformation.requestId"));
    assertEquals("MsoRequestId", vfModuleSDNCrequest.getRequestInformation().getRequestId());
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) HashMap(java.util.HashMap) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) URI(java.net.URI) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) GenericResourceApiVfModuleOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation) ServiceSubscription(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VolumeGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) GeneralTopologyObjectMapper(org.onap.so.bpmn.infrastructure.sdnc.mapper.GeneralTopologyObjectMapper) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Test(org.junit.Test)

Example 23 with ModelInfoVfModule

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

the class VfModuleTopologyOperationRequestMapperTest method reqMapperTest.

@Test
public void reqMapperTest() throws Exception {
    // prepare and set service instance
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
    modelInfoServiceInstance.setModelInvariantUuid("serviceModelInvariantUuid");
    modelInfoServiceInstance.setModelName("serviceModelName");
    modelInfoServiceInstance.setModelUuid("serviceModelUuid");
    modelInfoServiceInstance.setModelVersion("serviceModelVersion");
    serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
    // prepare Customer object
    Customer customer = new Customer();
    customer.setGlobalCustomerId("globalCustomerId");
    customer.setServiceSubscription(new ServiceSubscription());
    // set Customer on service instance
    customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
    // 
    RequestContext requestContext = new RequestContext();
    RequestParameters requestParameters = new RequestParameters();
    HashMap<String, Object> userParams1 = new HashMap<>();
    userParams1.put("key1", "value1");
    List<Map<String, Object>> userParams = new ArrayList<>();
    userParams.add(userParams1);
    requestParameters.setUserParams(userParams);
    requestContext.setRequestParameters(requestParameters);
    requestContext.setProductFamilyId("productFamilyId");
    GenericVnf vnf = new GenericVnf();
    vnf.setVnfId("testVnfId");
    vnf.setVnfType("testVnfType");
    ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
    modelInfoGenericVnf.setModelInvariantUuid("vnfModelInvariantUuid");
    modelInfoGenericVnf.setModelName("vnfModelName");
    modelInfoGenericVnf.setModelVersion("vnfModelVersion");
    modelInfoGenericVnf.setModelUuid("vnfModelUuid");
    modelInfoGenericVnf.setModelCustomizationUuid("vnfModelCustomizationUuid");
    vnf.setModelInfoGenericVnf(modelInfoGenericVnf);
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("testVfModuleId");
    vfModule.setVfModuleName("testVfModuleName");
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelInvariantUUID("vfModuleModelInvariantUuid");
    modelInfoVfModule.setModelName("vfModuleModelName");
    modelInfoVfModule.setModelVersion("vfModuleModelVersion");
    modelInfoVfModule.setModelUUID("vfModuleModelUuid");
    modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    CloudRegion cloudRegion = new CloudRegion();
    GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, vfModule, null, vnf, serviceInstance, customer, cloudRegion, requestContext, null, new URI("http://localhost:8080"));
    assertNull(vfModuleSDNCrequest.getServiceInformation().getOnapModelInformation().getModelCustomizationUuid());
    assertEquals("vnfModelCustomizationUuid", vfModuleSDNCrequest.getVnfInformation().getOnapModelInformation().getModelCustomizationUuid());
    assertEquals("vfModuleModelCustomizationUuid", vfModuleSDNCrequest.getVfModuleInformation().getOnapModelInformation().getModelCustomizationUuid());
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) HashMap(java.util.HashMap) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) ArrayList(java.util.ArrayList) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) URI(java.net.URI) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) GenericResourceApiVfModuleOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation) ServiceSubscription(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) HashMap(java.util.HashMap) Map(java.util.Map) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Test(org.junit.Test)

Example 24 with ModelInfoVfModule

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

the class VfModuleTopologyOperationRequestMapperTest method reqMapperChangeAssignTest.

@Test
public void reqMapperChangeAssignTest() throws Exception {
    // prepare and set service instance
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
    modelInfoServiceInstance.setModelInvariantUuid("serviceModelInvariantUuid");
    modelInfoServiceInstance.setModelName("serviceModelName");
    modelInfoServiceInstance.setModelUuid("serviceModelUuid");
    modelInfoServiceInstance.setModelVersion("serviceModelVersion");
    serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
    // prepare Customer object
    Customer customer = new Customer();
    customer.setGlobalCustomerId("globalCustomerId");
    customer.setServiceSubscription(new ServiceSubscription());
    // set Customer on service instance
    customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
    // 
    RequestContext requestContext = new RequestContext();
    RequestParameters requestParameters = new RequestParameters();
    HashMap<String, Object> userParams1 = new HashMap<>();
    userParams1.put("key1", "value1");
    List<Map<String, Object>> userParams = new ArrayList<>();
    userParams.add(userParams1);
    requestParameters.setUserParams(userParams);
    requestContext.setRequestParameters(requestParameters);
    requestContext.setProductFamilyId("productFamilyId");
    GenericVnf vnf = new GenericVnf();
    vnf.setVnfId("testVnfId");
    vnf.setVnfType("testVnfType");
    ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
    modelInfoGenericVnf.setModelInvariantUuid("vnfModelInvariantUuid");
    modelInfoGenericVnf.setModelName("vnfModelName");
    modelInfoGenericVnf.setModelVersion("vnfModelVersion");
    modelInfoGenericVnf.setModelUuid("vnfModelUuid");
    modelInfoGenericVnf.setModelCustomizationUuid("vnfModelCustomizationUuid");
    vnf.setModelInfoGenericVnf(modelInfoGenericVnf);
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("testVfModuleId");
    vfModule.setVfModuleName("testVfModuleName");
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelInvariantUUID("vfModuleModelInvariantUuid");
    modelInfoVfModule.setModelName("vfModuleModelName");
    modelInfoVfModule.setModelVersion("vfModuleModelVersion");
    modelInfoVfModule.setModelUUID("vfModuleModelUuid");
    modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    CloudRegion cloudRegion = new CloudRegion();
    GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN, vfModule, null, vnf, serviceInstance, customer, cloudRegion, requestContext, null, new URI("http://localhost:8080"));
    assertEquals("vnfModelCustomizationUuid", vfModuleSDNCrequest.getVnfInformation().getOnapModelInformation().getModelCustomizationUuid());
    assertEquals("vfModuleModelCustomizationUuid", vfModuleSDNCrequest.getVfModuleInformation().getOnapModelInformation().getModelCustomizationUuid());
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) HashMap(java.util.HashMap) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) ArrayList(java.util.ArrayList) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) URI(java.net.URI) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) GenericResourceApiVfModuleOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation) ServiceSubscription(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) HashMap(java.util.HashMap) Map(java.util.Map) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Test(org.junit.Test)

Example 25 with ModelInfoVfModule

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

the class VnfAdapterObjectMapperTest method test_createVolumeGroupRequestMapper.

@Test
public void test_createVolumeGroupRequestMapper() throws Exception {
    RequestContext requestContext = new RequestContext();
    requestContext.setMsoRequestId("msoRequestId");
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
    modelInfoServiceInstance.setModelVersion("modelVersion");
    serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("vnfId");
    genericVnf.setVnfName("vnfName");
    genericVnf.setVnfType("vnfType");
    serviceInstance.getVnfs().add(genericVnf);
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelName("modelName");
    modelInfoVfModule.setModelCustomizationUUID("modelCustomizationUUID");
    VolumeGroup volumeGroup = new VolumeGroup();
    volumeGroup.setVolumeGroupId("volumeGroupId");
    volumeGroup.setVolumeGroupName("volumeGroupName");
    volumeGroup.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
    volumeGroup.setModelInfoVfModule(modelInfoVfModule);
    serviceInstance.getVnfs().get(0).getVolumeGroups().add(volumeGroup);
    CloudRegion cloudRegion = new CloudRegion();
    cloudRegion.setLcpCloudRegionId("lcpCloudRegionId");
    cloudRegion.setTenantId("tenantId");
    OrchestrationContext orchestrationContext = new OrchestrationContext();
    orchestrationContext.setIsRollbackEnabled(true);
    String sdncVfModuleQueryResponse = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "genericResourceApiVfModuleSdncVfModuleTopology.json")));
    CreateVolumeGroupRequest expectedCreateVolumeGroupRequest = new CreateVolumeGroupRequest();
    expectedCreateVolumeGroupRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
    expectedCreateVolumeGroupRequest.setTenantId(cloudRegion.getTenantId());
    expectedCreateVolumeGroupRequest.setVolumeGroupId(volumeGroup.getVolumeGroupId());
    expectedCreateVolumeGroupRequest.setVolumeGroupName(volumeGroup.getVolumeGroupName());
    expectedCreateVolumeGroupRequest.setVnfType(genericVnf.getVnfType());
    expectedCreateVolumeGroupRequest.setVnfVersion(serviceInstance.getModelInfoServiceInstance().getModelVersion());
    expectedCreateVolumeGroupRequest.setVfModuleType(volumeGroup.getModelInfoVfModule().getModelName());
    expectedCreateVolumeGroupRequest.setModelCustomizationUuid(volumeGroup.getModelInfoVfModule().getModelCustomizationUUID());
    Map<String, Object> volumeGroupParams = new HashMap<>();
    volumeGroupParams.put("vnf_id", genericVnf.getVnfId());
    volumeGroupParams.put("vnf_name", genericVnf.getVnfName());
    volumeGroupParams.put("vf_module_id", volumeGroup.getVolumeGroupId());
    volumeGroupParams.put("vf_module_name", volumeGroup.getVolumeGroupName());
    volumeGroupParams.put("paramOne", "paramOneValue");
    volumeGroupParams.put("paramTwo", "paramTwoValue");
    volumeGroupParams.put("paramThree", "paramThreeValue");
    expectedCreateVolumeGroupRequest.setVolumeGroupParams(volumeGroupParams);
    expectedCreateVolumeGroupRequest.setSkipAAI(true);
    expectedCreateVolumeGroupRequest.setSuppressBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
    expectedCreateVolumeGroupRequest.setFailIfExists(false);
    MsoRequest msoRequest = new MsoRequest();
    msoRequest.setRequestId(requestContext.getMsoRequestId());
    msoRequest.setServiceInstanceId(serviceInstance.getServiceInstanceId());
    expectedCreateVolumeGroupRequest.setMsoRequest(msoRequest);
    expectedCreateVolumeGroupRequest.setMessageId("messageId");
    expectedCreateVolumeGroupRequest.setNotificationUrl("endpoint/VNFAResponse/messageId");
    doReturn("endpoint/").when(vnfAdapterObjectMapper).getProperty(isA(String.class));
    doReturn("messageId").when(vnfAdapterObjectMapper).getRandomUuid();
    CreateVolumeGroupRequest actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
    assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
    doReturn("false").when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
    actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
    assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
    doReturn(null).when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
    expectedCreateVolumeGroupRequest.setEnableBridge(true);
    actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
    assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
    doReturn("true").when(vnfAdapterObjectMapper).getProperty("mso.bridgeEnabled");
    expectedCreateVolumeGroupRequest.setEnableBridge(true);
    actualCreateVolumeGroupRequest = vnfAdapterObjectMapper.createVolumeGroupRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, volumeGroup, sdncVfModuleQueryResponse);
    assertThat(actualCreateVolumeGroupRequest, sameBeanAs(expectedCreateVolumeGroupRequest));
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) CreateVolumeGroupRequest(org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) HashMap(java.util.HashMap) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) OrchestrationContext(org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VolumeGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup) MsoRequest(org.onap.so.entity.MsoRequest) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Test(org.junit.Test)

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