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