Search in sources :

Example 1 with GenericResourceApiVfmoduleinformationVfModuleInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildVfModuleInformationTest_withModel.

@Test
public void buildVfModuleInformationTest_withModel() {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("TestVfModuleId");
    ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
    modelInfoVfModule.setModelInvariantUUID("testModelInvariantUUID");
    modelInfoVfModule.setModelName("testModelName");
    modelInfoVfModule.setModelVersion("testModelVersion");
    modelInfoVfModule.setModelUUID("testModelUUID");
    modelInfoVfModule.setModelCustomizationUUID("testModelCustomizationUUID");
    vfModule.setModelInfoVfModule(modelInfoVfModule);
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("TestVnfId");
    RequestContext requestContext = new RequestContext();
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setUsePreload(true);
    requestContext.setRequestParameters(requestParameters);
    GenericResourceApiVfmoduleinformationVfModuleInformation gcRequestInput = null;
    try {
        gcRequestInput = genObjMapper.buildVfModuleInformation(vfModule, genericVnf, serviceInstance, requestContext, true);
    } catch (MapperException ex) {
    }
    assertNotNull(gcRequestInput);
    assertNotNull(vfModule.getModelInfoVfModule());
    assertNotNull(gcRequestInput.getOnapModelInformation());
    assertEquals(modelInfoVfModule.getModelInvariantUUID(), gcRequestInput.getOnapModelInformation().getModelInvariantUuid());
    assertEquals(modelInfoVfModule.getModelName(), gcRequestInput.getOnapModelInformation().getModelName());
    assertEquals(modelInfoVfModule.getModelVersion(), gcRequestInput.getOnapModelInformation().getModelVersion());
    assertEquals(modelInfoVfModule.getModelUUID(), gcRequestInput.getOnapModelInformation().getModelUuid());
    assertEquals(modelInfoVfModule.getModelCustomizationUUID(), gcRequestInput.getOnapModelInformation().getModelCustomizationUuid());
    assertEquals(vfModule.getVfModuleId(), gcRequestInput.getVfModuleId());
    assertNotNull(gcRequestInput.getVfModuleId());
    assertTrue(gcRequestInput.getFromPreload());
}
Also used : ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) MapperException(org.onap.so.client.exception.MapperException) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) GenericResourceApiVfmoduleinformationVfModuleInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) Test(org.junit.Test)

Example 2 with GenericResourceApiVfmoduleinformationVfModuleInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildVfModuleInformationTest_withNoModelNoRequestContext.

@Test
public void buildVfModuleInformationTest_withNoModelNoRequestContext() {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("TestVfModuleId");
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("TestVnfId");
    GenericResourceApiVfmoduleinformationVfModuleInformation gcRequestInput = null;
    try {
        gcRequestInput = genObjMapper.buildVfModuleInformation(vfModule, genericVnf, serviceInstance, null, false);
    } catch (MapperException ex) {
    }
    assertNotNull(gcRequestInput);
    assertNull(vfModule.getModelInfoVfModule());
    assertNull(gcRequestInput.getOnapModelInformation());
    assertEquals(vfModule.getVfModuleId(), gcRequestInput.getVfModuleId());
    assertNotNull(gcRequestInput.getVfModuleId());
    assertTrue(gcRequestInput.getFromPreload());
}
Also used : GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) MapperException(org.onap.so.client.exception.MapperException) GenericResourceApiVfmoduleinformationVfModuleInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) Test(org.junit.Test)

Example 3 with GenericResourceApiVfmoduleinformationVfModuleInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildVfModuleInformationTest_withNoModelIsFromPreload.

@Test
public void buildVfModuleInformationTest_withNoModelIsFromPreload() {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("TestVfModuleId");
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("TestVnfId");
    RequestContext requestContext = new RequestContext();
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setUsePreload(true);
    requestContext.setRequestParameters(requestParameters);
    GenericResourceApiVfmoduleinformationVfModuleInformation gcRequestInput = null;
    try {
        gcRequestInput = genObjMapper.buildVfModuleInformation(vfModule, genericVnf, serviceInstance, requestContext, false);
    } catch (MapperException ex) {
    }
    assertNotNull(gcRequestInput);
    assertNull(vfModule.getModelInfoVfModule());
    assertNull(gcRequestInput.getOnapModelInformation());
    assertEquals(vfModule.getVfModuleId(), gcRequestInput.getVfModuleId());
    assertNotNull(gcRequestInput.getVfModuleId());
    assertTrue(gcRequestInput.getFromPreload());
}
Also used : GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) MapperException(org.onap.so.client.exception.MapperException) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) GenericResourceApiVfmoduleinformationVfModuleInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) Test(org.junit.Test)

Example 4 with GenericResourceApiVfmoduleinformationVfModuleInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildVfModuleInformationTest_withNoModelIsNotFromPreload.

@Test
public void buildVfModuleInformationTest_withNoModelIsNotFromPreload() {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("TestVfModuleId");
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("TestVnfId");
    RequestContext requestContext = new RequestContext();
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setUsePreload(false);
    requestContext.setRequestParameters(requestParameters);
    GenericResourceApiVfmoduleinformationVfModuleInformation gcRequestInput = null;
    try {
        gcRequestInput = genObjMapper.buildVfModuleInformation(vfModule, genericVnf, serviceInstance, requestContext, false);
    } catch (MapperException ex) {
    }
    assertNotNull(gcRequestInput);
    assertNull(vfModule.getModelInfoVfModule());
    assertNull(gcRequestInput.getOnapModelInformation());
    assertEquals(vfModule.getVfModuleId(), gcRequestInput.getVfModuleId());
    assertNotNull(gcRequestInput.getVfModuleId());
    assertFalse(gcRequestInput.getFromPreload());
}
Also used : GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) MapperException(org.onap.so.client.exception.MapperException) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) GenericResourceApiVfmoduleinformationVfModuleInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) RequestParameters(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters) Test(org.junit.Test)

Example 5 with GenericResourceApiVfmoduleinformationVfModuleInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildVfModuleInformationTest_withNoModelNoRequestParameters.

@Test
public void buildVfModuleInformationTest_withNoModelNoRequestParameters() {
    VfModule vfModule = new VfModule();
    vfModule.setVfModuleId("TestVfModuleId");
    ServiceInstance serviceInstance = new ServiceInstance();
    serviceInstance.setServiceInstanceId("serviceInstanceId");
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId("TestVnfId");
    RequestContext requestContext = new RequestContext();
    GenericResourceApiVfmoduleinformationVfModuleInformation gcRequestInput = null;
    try {
        gcRequestInput = genObjMapper.buildVfModuleInformation(vfModule, genericVnf, serviceInstance, requestContext, false);
    } catch (MapperException ex) {
    }
    assertNotNull(gcRequestInput);
    assertNull(vfModule.getModelInfoVfModule());
    assertNull(gcRequestInput.getOnapModelInformation());
    assertEquals(vfModule.getVfModuleId(), gcRequestInput.getVfModuleId());
    assertNotNull(gcRequestInput.getVfModuleId());
    assertTrue(gcRequestInput.getFromPreload());
}
Also used : GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) MapperException(org.onap.so.client.exception.MapperException) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) GenericResourceApiVfmoduleinformationVfModuleInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation) ModelInfoVfModule(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule) Test(org.junit.Test)

Aggregations

GenericResourceApiVfmoduleinformationVfModuleInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation)7 MapperException (org.onap.so.client.exception.MapperException)6 Test (org.junit.Test)5 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)5 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)5 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)5 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)5 ModelInfoVfModule (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule)5 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)4 RequestParameters (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters)3 GenericResourceApiOnapmodelinformationOnapModelInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation)1 GenericResourceApiRequestActionEnumeration (org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration)1 GenericResourceApiRequestinformationRequestInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation)1 GenericResourceApiSdncrequestheaderSdncRequestHeader (org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader)1 GenericResourceApiServiceinformationServiceInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation)1 GenericResourceApiSvcActionEnumeration (org.onap.sdnc.northbound.client.model.GenericResourceApiSvcActionEnumeration)1 GenericResourceApiVfModuleOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation)1 GenericResourceApiVfmodulerequestinputVfModuleRequestInput (org.onap.sdnc.northbound.client.model.GenericResourceApiVfmodulerequestinputVfModuleRequestInput)1 GenericResourceApiVnfinformationVnfInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation)1