diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-10-11 13:55:37 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-10-12 10:10:16 -0400 |
commit | 6ba0a22bc952232d14d2d24c5f73a42aae2791a9 (patch) | |
tree | 9046e63bccb77ca3e2df4ae7ceab44cc238dd074 /bpmn/mso-infrastructure-bpmn/src/test/java/org/onap | |
parent | 58c1d90a787979e507f559d7075aac8a1428df42 (diff) |
Dynamic Cloud Owner Support
added in cloud configuration object to request params
Fix Bean scanning so it picks up the resttemplate
removed unnecessary RestTemplate Bean configurations
corrected typo in CloudConfiguration class
updated gr api test cases with dynamic cloud owner
updated groovy files to allow for dynamic cloud owner values
updated GR API layer to include cloud owner
added enum for default cloud owner
add cloud owner variable to camunda in mapping
removed references to att-aic from BBInputSetup
updated aai schema dependency to 1.3.1 from 1.3.0
Fixed incorrect type AAIUri and updated logging in the method.
use existing service instance id instead of generating
Pass cloudOwner to process to propagate to subprocesses.
NOTE: our aai-schema dependency is 1.3.1-SNAPSHOT to be
compatible with the cloud owner changes here. The
releaesed 1.3.0 version is NOT compatible.
Change-Id: I43b46774b77981d1c8bfe7c7a79b9434889e62ae
Issue-ID: SO-1128
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test/java/org/onap')
-rw-r--r-- | bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenericGetVnfIT.java | 190 |
1 files changed, 0 insertions, 190 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenericGetVnfIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenericGetVnfIT.java deleted file mode 100644 index 10c0640b17..0000000000 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenericGetVnfIT.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. - */ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.common; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVceByNameWithDepth; -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth; -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfById_500; -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfByNameWithDepth; -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetVceById; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.junit.Test; -import org.onap.so.BaseIntegrationTest; - -/** - * Please describe the GenericGetVnfTest.java class - * - */ - -public class GenericGetVnfIT extends BaseIntegrationTest { - - @Test - - public void testGenericGetVnf_success_genericVnf() throws Exception{ - MockGetGenericVnfByIdWithDepth("testVnfId123", 1, "GenericFlows/getGenericVnfByNameResponse.xml"); - - Map<String, Object> variables = new HashMap<>(); - setVariables(variables, "testVnfId123", "testVnfName123", "generic-vnf"); - - String processId = invokeSubProcess( "GenericGetVnf", variables); - - - String successIndicator = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_SuccessIndicator",processId); - String found = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_FoundIndicator",processId); - String vnf = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_vnf",processId); - String byName = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_getVnfByName",processId); - String response = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowResponse",processId); - String workflowException = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowException",processId); - - assertEquals("true", successIndicator); - assertEquals("true", found); - assertEquals("false", byName); - assertNotNull(response); - assertNotNull(vnf); - assertEquals(null, workflowException); - - } - - @Test - - public void testGenericGetVnf_success_vce() throws Exception{ - MockGetVceById("testVnfId123[?]depth=1", "GenericFlows/getVceResponse.xml"); - - Map<String, Object> variables = new HashMap<>(); - setVariables(variables, "testVnfId123", "testVnfName123", "vce"); - - String processId = invokeSubProcess( "GenericGetVnf", variables); - - - String successIndicator = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_SuccessIndicator",processId); - String found = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_FoundIndicator",processId); - String vnf = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_vnf",processId); - String byName = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_getVnfByName",processId); - String response = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowResponse",processId); - String workflowException = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowException",processId); - - assertEquals("true", successIndicator); - assertEquals("true", found); - assertEquals("false", byName); - assertNotNull(response); - assertNotNull(vnf); - assertEquals(null, workflowException); - - } - - @Test - - public void testGenericGetVnf_success_genericVnfByName() throws Exception{ - MockGetGenericVnfByNameWithDepth("testVnfName123", 1, "GenericFlows/getGenericVnfResponse.xml"); - - Map<String, Object> variables = new HashMap<>(); - setVariables(variables, "", "testVnfName123", "generic-vnf"); - - String processId = invokeSubProcess( "GenericGetVnf", variables); - - - String successIndicator = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_SuccessIndicator",processId); - String found = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_FoundIndicator",processId); - String vnf = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_vnf",processId); - String byName = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_getVnfByName",processId); - String response = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowResponse",processId); - String workflowException = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowException",processId); - - assertEquals("true", successIndicator); - assertEquals("true", found); - assertEquals("true", byName); - assertNotNull(response); - assertNotNull(vnf); - assertEquals(null, workflowException); - - } - - @Test - - public void testGenericGetVnf_success_vceByName() throws Exception{ - MockGetGenericVceByNameWithDepth("testVnfName123", 1, "GenericFlows/getVceByNameResponse.xml"); - - Map<String, Object> variables = new HashMap<>(); - setVariables(variables, null, "testVnfName123", "vce"); - - String processId = invokeSubProcess( "GenericGetVnf", variables); - - - String successIndicator = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_SuccessIndicator",processId); - String found = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_FoundIndicator",processId); - String vnf = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_vnf",processId); - String byName = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_getVnfByName",processId); - String response = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowResponse",processId); - String workflowException = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowException",processId); - - assertEquals("true", successIndicator); - assertEquals("true", found); - assertEquals("true", byName); - assertNotNull(response); - assertNotNull(vnf); - assertEquals(null, workflowException); - - } - - - - @Test - public void testGenericGetVnf_error_genericVnf500() throws Exception{ - - MockGetGenericVnfById_500("testVnfId123_500"); - - Map<String, Object> variables = new HashMap<>(); - setVariables(variables, "testVnfId123_500", "testVnfId123_500", "generic-vnf"); - - String processId = invokeSubProcess( "GenericGetVnf", variables); - - - String successIndicator = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_SuccessIndicator",processId); - String found = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_FoundIndicator",processId); - String workflowException = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "WorkflowException",processId); - String byName = BPMNUtil.getVariable(processEngine, "GenericGetVnf", "GENGV_getVnfByName",processId); - - String expectedWorkflowException = "WorkflowException[processKey=GenericGetVnf,errorCode=500,errorMessage=Received a bad response from AAI,workStep=*]"; - - assertEquals("false", successIndicator); - assertEquals("false", found); - assertEquals("false", byName); - - assertEquals(expectedWorkflowException, workflowException); - } - - private void setVariables(Map<String, Object> variables, String vnfId, String vnfName, String type) { - variables.put("isDebugLogEnabled", "true"); - variables.put("GENGV_vnfId", vnfId); - variables.put("GENGV_vnfName",vnfName); - variables.put("GENGV_type", type); - variables.put("mso-request-id", UUID.randomUUID().toString()); - } -} |