Search in sources :

Example 1 with Pnf

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);
    }
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException)

Example 2 with Pnf

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;
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf)

Example 3 with 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;
}
Also used : ServiceProxy(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy) ModelInfoServiceProxy(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy) Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf)

Example 4 with Pnf

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));
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) File(java.io.File) Test(org.junit.Test)

Example 5 with Pnf

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);
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) Test(org.junit.Test)

Aggregations

Pnf (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf)42 Test (org.junit.Test)22 ModelInfoPnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf)11 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)8 AAIResourceUri (org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri)5 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)5 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)4 ServiceProxy (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 AAICommonObjectMapperProvider (org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider)3 AAIResultWrapper (org.onap.aaiclient.client.aai.entities.AAIResultWrapper)3 BuildingBlockExecution (org.onap.so.bpmn.common.BuildingBlockExecution)3 OrchestrationStatus (org.onap.so.db.catalog.beans.OrchestrationStatus)3 SerializationFeature (com.fasterxml.jackson.databind.SerializationFeature)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Objects (java.util.Objects)2