Search in sources :

Example 16 with BBObjectNotFoundException

use of org.onap.so.client.exception.BBObjectNotFoundException in project so by onap.

the class AppcRunTasksTest method runAppcCommandBBObjectNotFoundException.

@Test
public void runAppcCommandBBObjectNotFoundException() throws BBObjectNotFoundException {
    execution.getLookupMap().put(ResourceKey.GENERIC_VNF_ID, "EXCEPTION-TEST");
    fillRequiredAppcExecutionFields();
    when(extractPojosForBB.extractByKey(eq(execution), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(new BBObjectNotFoundException());
    appcRunTasks.runAppcCommand(execution, Action.Lock);
    verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), eq("No valid VNF exists"));
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) BuildingBlockExecution(org.onap.so.bpmn.common.BuildingBlockExecution) Test(org.junit.Test)

Example 17 with BBObjectNotFoundException

use of org.onap.so.client.exception.BBObjectNotFoundException in project so by onap.

the class TestDataSetup method setVpnBondingLink.

public VpnBondingLink setVpnBondingLink() {
    VpnBondingLink vpnBondingLink = buildVpnBondingLink();
    ServiceInstance serviceInstance = null;
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    serviceInstance.getVpnBondingLinks().add(vpnBondingLink);
    lookupKeyMap.put(ResourceKey.VPN_BONDING_LINK_ID, vpnBondingLink.getVpnBondingLinkId());
    return vpnBondingLink;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) VpnBondingLink(org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 18 with BBObjectNotFoundException

use of org.onap.so.client.exception.BBObjectNotFoundException in project so by onap.

the class TestDataSetup method setConfiguration.

public Configuration setConfiguration() {
    Configuration config = new Configuration();
    config.setConfigurationId("testConfigurationId");
    List<Configuration> configurations = new ArrayList<>();
    configurations.add(config);
    ServiceInstance serviceInstance = new ServiceInstance();
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, "testConfigurationId");
    serviceInstance.setConfigurations(configurations);
    return config;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) ArrayList(java.util.ArrayList) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 19 with BBObjectNotFoundException

use of org.onap.so.client.exception.BBObjectNotFoundException in project so by onap.

the class TestDataSetup method setGenericVnf.

public GenericVnf setGenericVnf() {
    GenericVnf genericVnf = buildGenericVnf();
    ServiceInstance serviceInstance = null;
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    serviceInstance.getVnfs().add(genericVnf);
    lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, genericVnf.getVnfId());
    return genericVnf;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 20 with BBObjectNotFoundException

use of org.onap.so.client.exception.BBObjectNotFoundException in project so by onap.

the class SDNCQueryTasksTest method before.

@Before
public void before() throws BBObjectNotFoundException {
    serviceInstance = setServiceInstance();
    genericVnf = setGenericVnf();
    vfModule = setVfModule();
    doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(ONAPComponentsList.class));
    when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID))).thenReturn(serviceInstance);
    when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(genericVnf);
    when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
}
Also used : BuildingBlockExecution(org.onap.so.bpmn.common.BuildingBlockExecution) BadResponseException(org.onap.so.client.exception.BadResponseException) ExpectedException(org.junit.rules.ExpectedException) BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) ONAPComponentsList(org.onap.logging.filter.base.ONAPComponentsList) BpmnError(org.camunda.bpm.engine.delegate.BpmnError) Before(org.junit.Before)

Aggregations

BBObjectNotFoundException (org.onap.so.client.exception.BBObjectNotFoundException)56 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)23 BuildingBlockExecution (org.onap.so.bpmn.common.BuildingBlockExecution)20 BpmnError (org.camunda.bpm.engine.delegate.BpmnError)18 Before (org.junit.Before)18 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)18 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)12 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)10 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)9 VolumeGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup)6 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)6 InstanceGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)5 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)5 Collection (org.onap.so.bpmn.servicedecomposition.bbobjects.Collection)4 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)4 BadResponseException (org.onap.so.client.exception.BadResponseException)4 Test (org.junit.Test)3 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2