From fe7a17f308f23ea8963d0948b5dc5388d626c1f9 Mon Sep 17 00:00:00 2001 From: Sunil Date: Sat, 25 Apr 2020 13:48:21 +0530 Subject: Adding Generic VNF information in ControllerExeuctionBB flow Solving BlueprintName and BlueprintVersion issue Changing vf-module to vfmodule Updating AAI with Orchestration status Issue-ID: SO-2806 Signed-off-by: sunilb Change-Id: I91aa653b946bae3940000f724710de87af3ce7df --- .../aai/tasks/AAIUpdateTasksTest.java | 38 ++++++++++++++++++++++ .../tasks/ControllerExecutionTest.java | 4 +-- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test/java') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java index e5b003a437..a7dfe7f7a4 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -753,4 +755,40 @@ public class AAIUpdateTasksTest extends BaseTaskTest { when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.PNF))).thenReturn(pnf); return pnf; } + + @Test + public void updateOrchestrationStatusVnfConfigAssignedTest() throws Exception { + doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGASSIGNED); + + aaiUpdateTasks.updateOrchestrationStatus(execution, "vnf", "config-assign"); + + verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGASSIGNED); + } + + @Test + public void updateOrchestrationStatusVnfConfigDeployedTest() throws Exception { + doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGDEPLOYED); + + aaiUpdateTasks.updateOrchestrationStatus(execution, "vnf", "config-deploy"); + + verify(aaiVnfResources, times(1)).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.CONFIGDEPLOYED); + } + + @Test + public void updateOrchestrationStatusVfModuleConfigDeployedTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGDEPLOYED); + aaiUpdateTasks.updateOrchestrationStatus(execution, "vfmodule", "config-deploy"); + verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGDEPLOYED); + } + + @Test + public void updateOrchestrationStatusVfModuleConfigAssignedTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGASSIGNED); + aaiUpdateTasks.updateOrchestrationStatus(execution, "vfmodule", "config-assign"); + verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, + OrchestrationStatus.CONFIGASSIGNED); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java index 72a987c395..f35939ec39 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ControllerExecutionTest.java @@ -99,7 +99,7 @@ public class ControllerExecutionTest extends BaseTaskTest { controllerExecution.setControllerActorScopeAction(execution); assertEquals(TEST_SCOPE, execution.getVariable("scope")); assertEquals(TEST_ACTION, execution.getVariable("action")); - assertEquals(TEST_CONTROLLER_ACTOR, execution.getVariable("controllerActor")); + assertEquals(TEST_CONTROLLER_ACTOR, execution.getVariable("actor")); } @@ -114,7 +114,7 @@ public class ControllerExecutionTest extends BaseTaskTest { bbNameSelectionReference.setScope(TEST_SCOPE); doReturn(bbNameSelectionReference).when(catalogDbClient).getBBNameSelectionReference(TEST_CONTROLLER_ACTOR, TEST_SCOPE, TEST_ACTION); - execution.setVariable("controllerActor", TEST_CONTROLLER_ACTOR); + execution.setVariable("actor", TEST_CONTROLLER_ACTOR); execution.setVariable("scope", TEST_SCOPE); execution.setVariable("action", TEST_ACTION); -- cgit 1.2.3-korg