Search in sources :

Example 6 with Pnf

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.

the class AAIUpdateTasksTest method updateOrchestrationStatusInventoriedPnfTest.

@Test
public void updateOrchestrationStatusInventoriedPnfTest() throws Exception {
    Pnf pnf = preparePnfAndExtractForPnf();
    doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.INVENTORIED);
    aaiUpdateTasks.updateOrchestrationStatusInventoriedPnf(execution);
    verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.INVENTORIED);
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) Test(org.junit.Test)

Example 7 with Pnf

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.

the class AAIUpdateTasksTest method updateOrchestrationStatusActivePnfExceptionTest.

@Test
public void updateOrchestrationStatusActivePnfExceptionTest() throws Exception {
    Pnf pnf = preparePnfAndExtractForPnf();
    doThrow(RuntimeException.class).when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ACTIVE);
    expectedException.expect(BpmnError.class);
    aaiUpdateTasks.updateOrchestrationStatusActivePnf(execution);
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) Test(org.junit.Test)

Example 8 with Pnf

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.

the class AAIUpdateTasksTest method updateOrchestrationStatusActivePnfTest.

@Test
public void updateOrchestrationStatusActivePnfTest() throws Exception {
    Pnf pnf = preparePnfAndExtractForPnf();
    doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ACTIVE);
    aaiUpdateTasks.updateOrchestrationStatusActivePnf(execution);
    verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ACTIVE);
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) Test(org.junit.Test)

Example 9 with Pnf

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.

the class AAIUpdateTasksTest method preparePnfAndExtractForPnf.

private Pnf preparePnfAndExtractForPnf() throws BBObjectNotFoundException {
    Pnf pnf = buildPnf();
    when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.PNF))).thenReturn(pnf);
    return pnf;
}
Also used : Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf)

Example 10 with Pnf

use of org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf in project so by onap.

the class TestDataSetup 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)

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