use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.
the class AAICreateTasks method createPnf.
public void createPnf(BuildingBlockExecution execution) {
try {
Pnf pnf = extractPojosForBB.extractByKey(execution, ResourceKey.PNF);
aaiPnfResources.checkIfPnfExistsInAaiAndCanBeUsed(pnf);
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
aaiPnfResources.createPnfAndConnectServiceInstance(pnf, serviceInstance);
} catch (Exception e) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.
the class BuildingBlockTestDataSetup method buildPnf.
public Pnf buildPnf() {
pnfCounter++;
Pnf pnf = new Pnf();
pnf.setPnfId("testPnfId" + pnfCounter);
pnf.setPnfName("testPnfName" + pnfCounter);
return pnf;
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.
the class BuildingBlockTestDataSetup method buildServiceProxy.
public ServiceProxy buildServiceProxy() {
serviceProxyCounter++;
ServiceProxy serviceProxy = new ServiceProxy();
serviceProxy.setServiceInstance(buildServiceInstance());
serviceProxy.getServiceInstance().getVnfs().add(buildGenericVnf());
Pnf primaryPnf = buildPnf();
primaryPnf.setRole("Primary");
serviceProxy.getServiceInstance().getPnfs().add(primaryPnf);
Pnf secondaryPnf = buildPnf();
secondaryPnf.setRole("Secondary");
serviceProxy.getServiceInstance().getPnfs().add(secondaryPnf);
return serviceProxy;
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.
the class BBInputSetupMapperLayerTest method testMapAAIPnfIntoPnf.
@Test
public void testMapAAIPnfIntoPnf() throws IOException {
Pnf expected = mapper.readValue(new File(RESOURCE_PATH + "PnfExpected.json"), Pnf.class);
org.onap.aai.domain.yang.Pnf aaiPnf = mapper.readValue(new File(RESOURCE_PATH + "aaiPnfInput.json"), org.onap.aai.domain.yang.Pnf.class);
Pnf actual = bbInputSetupMapperLayer.mapAAIPnfIntoPnf(aaiPnf);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.
the class AAIUpdateTasksTest method updateOrchestrationStatusRegisteredPnfTest.
@Test
public void updateOrchestrationStatusRegisteredPnfTest() throws Exception {
Pnf pnf = preparePnfAndExtractForPnf();
doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTERED);
aaiUpdateTasks.updateOrchestrationStatusRegisteredPnf(execution);
verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTERED);
}
Aggregations