Search in sources :

Example 81 with ModelInfo

use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.

the class RequestHandlerUtilsUnitTest method getIsBaseVfModuleModelVersionIdNullTest.

@Test
public void getIsBaseVfModuleModelVersionIdNullTest() throws ApiException {
    ModelInfo modelInfo = new ModelInfo();
    modelInfo.setModelInvariantId(MODEL_INVARIANT_ID);
    modelInfo.setModelVersion(MODEL_VERSION);
    modelInfo.setModelName(MODEL_NAME);
    Boolean expected = false;
    doReturn(null).when(catDbClient).getVfModuleByModelInvariantUUIDAndModelVersion(MODEL_INVARIANT_ID, MODEL_VERSION);
    Boolean result = requestHandler.getIsBaseVfModule(modelInfo, Action.deleteInstance, vnfType, sdcServiceModelVersion, currentActiveRequest);
    assertEquals(result, expected);
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) Test(org.junit.Test)

Example 82 with ModelInfo

use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.

the class RequestHandlerUtilsUnitTest method getModelTypeTest.

@Test
public void getModelTypeTest() throws ApiException {
    ModelType modelTypeExpected = ModelType.service;
    ModelInfo modelInfo = new ModelInfo();
    modelInfo.setModelType(ModelType.service);
    ModelType modelTypeResult = requestHandler.getModelType(Action.createInstance, modelInfo);
    assertEquals(modelTypeResult, modelTypeExpected);
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) ModelType(org.onap.so.serviceinstancebeans.ModelType) Test(org.junit.Test)

Example 83 with ModelInfo

use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.

the class RequestHandlerUtilsUnitTest method getIsBaseVfModuleTrueTest.

@Test
public void getIsBaseVfModuleTrueTest() throws ApiException {
    VfModule vfModule = new VfModule();
    vfModule.setIsBase(true);
    ModelInfo modelInfo = new ModelInfo();
    modelInfo.setModelVersionId(MODEL_VERSION_ID);
    doReturn(vfModule).when(catDbClient).getVfModuleByModelUUID(MODEL_VERSION_ID);
    Boolean expected = true;
    Boolean result = requestHandler.getIsBaseVfModule(modelInfo, action, vnfType, sdcServiceModelVersion, currentActiveRequest);
    assertEquals(result, expected);
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) VfModule(org.onap.so.db.catalog.beans.VfModule) Test(org.junit.Test)

Example 84 with ModelInfo

use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.

the class RequestHandlerUtilsUnitTest method getIsBaseVfModuleModelVersionNullTest.

@Test
public void getIsBaseVfModuleModelVersionNullTest() throws ApiException {
    ModelInfo modelInfo = new ModelInfo();
    modelInfo.setModelInvariantId(MODEL_INVARIANT_ID);
    modelInfo.setModelName(MODEL_NAME);
    Boolean expected = false;
    Boolean result = requestHandler.getIsBaseVfModule(modelInfo, Action.deleteInstance, vnfType, sdcServiceModelVersion, currentActiveRequest);
    assertEquals(result, expected);
}
Also used : ModelInfo(org.onap.so.serviceinstancebeans.ModelInfo) Test(org.junit.Test)

Aggregations

ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)84 Test (org.junit.Test)46 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)35 Service (org.onap.so.db.catalog.beans.Service)30 HashMap (java.util.HashMap)18 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)18 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)17 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)17 RelatedInstanceList (org.onap.so.serviceinstancebeans.RelatedInstanceList)15 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)14 RelatedInstance (org.onap.so.serviceinstancebeans.RelatedInstance)14 ServiceInstancesRequest (org.onap.so.serviceinstancebeans.ServiceInstancesRequest)14 VnfResourceCustomization (org.onap.so.db.catalog.beans.VnfResourceCustomization)12 RequestInfo (org.onap.so.serviceinstancebeans.RequestInfo)12 ServiceModel (org.onap.so.bpmn.servicedecomposition.entities.ServiceModel)11 CloudConfiguration (org.onap.so.serviceinstancebeans.CloudConfiguration)11 File (java.io.File)10 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)10 VolumeGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup)10 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)10