Search in sources :

Example 1 with AuditInventory

use of org.onap.so.audit.beans.AuditInventory in project so by onap.

the class AuditTasksTest method setupAuditVariableTest.

@Test
public void setupAuditVariableTest() throws Exception {
    AuditInventory expectedAuditInventory = new AuditInventory();
    expectedAuditInventory.setCloudOwner("testCloudOwner");
    expectedAuditInventory.setCloudRegion("testLcpCloudRegionId");
    expectedAuditInventory.setHeatStackName("testVfModuleName1");
    expectedAuditInventory.setVfModuleId("testVfModuleId1");
    expectedAuditInventory.setTenantId("testTenantId");
    expectedAuditInventory.setGenericVnfId("testVnfId1");
    expectedAuditInventory.setMsoRequestId("fb06f44c-c797-4f38-9b17-b4b975344600");
    auditTasks.setupAuditVariable(execution);
// assertThat((AuditInventory) execution.getVariable("auditInventory"), sameBeanAs(expectedAuditInventory));
}
Also used : AuditInventory(org.onap.so.audit.beans.AuditInventory) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 2 with AuditInventory

use of org.onap.so.audit.beans.AuditInventory in project so by onap.

the class AuditTasks method createAuditInventory.

private AuditInventory createAuditInventory(BuildingBlockExecution execution) throws BBObjectNotFoundException {
    AuditInventory auditInventory = new AuditInventory();
    GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
    VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
    GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
    CloudRegion cloudRegion = gBBInput.getCloudRegion();
    auditInventory.setMsoRequestId(gBBInput.getRequestContext().getMsoRequestId());
    auditInventory.setCloudOwner(cloudRegion.getCloudOwner());
    auditInventory.setCloudRegion(cloudRegion.getLcpCloudRegionId());
    auditInventory.setTenantId(cloudRegion.getTenantId());
    auditInventory.setVfModuleId(vfModule.getVfModuleId());
    auditInventory.setHeatStackName(vfModule.getVfModuleName());
    auditInventory.setGenericVnfId(genericVnf.getVnfId());
    return auditInventory;
}
Also used : CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) AuditInventory(org.onap.so.audit.beans.AuditInventory) VfModule(org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)

Aggregations

AuditInventory (org.onap.so.audit.beans.AuditInventory)2 Test (org.junit.Test)1 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)1 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)1 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)1 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)1 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)1