diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
16 files changed, 0 insertions, 1148 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CustomE2EGetServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CustomE2EGetServiceTest.groovy deleted file mode 100644 index a8c10b1e81..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CustomE2EGetServiceTest.groovy +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ============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.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Assert -import org.junit.Before -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.ArgumentCaptor -import org.mockito.Captor -import org.mockito.Mockito -import org.mockito.runners.MockitoJUnitRunner - -import static org.mockito.Mockito.times -import static org.mockito.Mockito.when -import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetServiceInstance -import static org.onap.so.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById -import static org.onap.so.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName - -/** - * @author sushilma - * @since January 10, 2018 - */ -@RunWith(MockitoJUnitRunner.class) -@Ignore -class CustomE2EGetServiceTest extends MsoGroovyTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(28090) - - @Captor - static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) - - @Test - public void testObtainServiceInstanceUrlById (){ - ExecutionEntity mockExecution = setupMockWithPrefix('CustomE2EGetService','GENGS_') - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.default.aai.v8.nodes-query.uri")).thenReturn('/aai/v8/search/nodes-query') - when(mockExecution.getVariable("GENGS_type")).thenReturn('service-instance') - when(mockExecution.getVariable("GENGS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") - MockNodeQueryServiceInstanceById("MIS%2F1604%2F0026%2FSW_INTERNET", "GenericFlows/getSIUrlById.xml"); - CustomE2EGetService customE2EGetService = new CustomE2EGetService(); - customE2EGetService.obtainServiceInstanceUrlById(mockExecution) - Mockito.verify(mockExecution, times(9)).setVariable(captor.capture(), captor.capture()) - Assert.assertEquals(200, captor.getAllValues().get(5)) - } - - @Test - public void testObtainServiceInstanceUrlByName (){ - ExecutionEntity mockExecution = setupMockWithPrefix('CustomE2EGetService','GENGS_') - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.default.aai.v8.nodes-query.uri")).thenReturn('/aai/v8/search/nodes-query') - when(mockExecution.getVariable("GENGS_type")).thenReturn('service-instance') - when(mockExecution.getVariable("GENGS_serviceInstanceName")).thenReturn("1604-MVM-26") - MockNodeQueryServiceInstanceByName("1604-MVM-26", "GenericFlows/getSIUrlByName.xml"); - CustomE2EGetService customE2EGetService = new CustomE2EGetService(); - customE2EGetService.obtainServiceInstanceUrlByName(mockExecution) - Mockito.verify(mockExecution, times(8)).setVariable(captor.capture(), captor.capture()) - Assert.assertEquals(200, captor.getAllValues().get(5)) - } - - @Test - public void testServiceObject (){ - ExecutionEntity mockExecution = setupMockWithPrefix('CustomE2EGetService','GENGS_') - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.default.aai.v8.nodes-query.uri")).thenReturn('/aai/v8/search/nodes-query') - when(mockExecution.getVariable("GENGS_type")).thenReturn('service-instance') - when(mockExecution.getVariable("GENGS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") - when(mockExecution.getVariable("GENGS_resourceLink")).thenReturn("/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/1234453") - MockGetServiceInstance("MSO_1610_dev", "MSO-dev-service-type", "1234453", "GenericFlows/getServiceInstance.xml"); - CustomE2EGetService customE2EGetService = new CustomE2EGetService(); - customE2EGetService.getServiceObject(mockExecution) - Mockito.verify(mockExecution, times(7)).setVariable(captor.capture(), captor.capture()) - Assert.assertEquals(200, captor.getAllValues().get(5)) - } -} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetServiceTest.groovy deleted file mode 100644 index 49edd813f7..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetServiceTest.groovy +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============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.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.junit.Assert -import org.junit.Before -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.ArgumentCaptor -import org.mockito.Captor -import org.mockito.Mockito -import org.mockito.runners.MockitoJUnitRunner -import org.onap.so.bpmn.core.WorkflowException - -import static com.github.tomakehurst.wiremock.client.WireMock.* -import static org.mockito.Mockito.* - -@RunWith(MockitoJUnitRunner.class) -@Ignore -class GenericGetServiceTest { - - def prefix = "GENGS_" - @Captor - ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class); - - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - @Test - public void testGetServiceObject() { - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true') - when(mockExecution.getVariable("aai.endpoint")).thenReturn('http://localhost:8090') - when(mockExecution.getVariable(prefix + "type")).thenReturn('service-instance') - when(mockExecution.getVariable(prefix + "serviceInstanceId")).thenReturn('12345') - when(mockExecution.getVariable(prefix + "resourceLink")).thenReturn("/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/") - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/') - - mockData() - GenericGetService obj = new GenericGetService() - obj.getServiceObject(mockExecution) - - Mockito.verify(mockExecution).setVariable("prefix", prefix) - Mockito.verify(mockExecution).setVariable(prefix + "getServiceUrl", "http://localhost:8090/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/") - Mockito.verify(mockExecution).setVariable(prefix + "getServiceResponseCode", 200) - } - - @Test - public void testGetServiceObjectEndpointNull() { - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true') - when(mockExecution.getVariable("aai.endpoint")).thenReturn(null) - when(mockExecution.getVariable(prefix + "type")).thenReturn('service-instance') - when(mockExecution.getVariable(prefix + "serviceInstanceId")).thenReturn('12345') - when(mockExecution.getVariable(prefix + "resourceLink")).thenReturn("/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/") - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/') - - mockData() - try { - GenericGetService obj = new GenericGetService() - obj.getServiceObject(mockExecution) - } catch (Exception ex) { - println " Test End - Handle catch-throw BpmnError()! " - } - - Mockito.verify(mockExecution, times(3)).setVariable(captor.capture(), captor.capture()) - WorkflowException workflowException = captor.getValue() - Assert.assertEquals(9999, workflowException.getErrorCode()) - Assert.assertEquals("org.apache.http.client.ClientProtocolException", workflowException.getErrorMessage()) - } - - private void mockData() { - stubFor(get(urlMatching(".*/aai/v[0-9]+/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/.*")) - .willReturn(aResponse() - .withStatus(200).withHeader("Content-Type", "text/xml") - .withBodyFile(""))) - } - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("GenericGetService") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("GenericGetService") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("GenericGetService") - when(mockExecution.getProcessInstanceId()).thenReturn("GenericGetService") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - return mockExecution - } -} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetVnfTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetVnfTest.groovy deleted file mode 100644 index 1aef78f0d5..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericGetVnfTest.groovy +++ /dev/null @@ -1,180 +0,0 @@ -/*- - * ============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.scripts - -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.junit.Assert -import org.junit.Before -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.ArgumentCaptor -import org.mockito.Captor -import org.mockito.Mockito -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.onap.so.bpmn.core.WorkflowException - -import static com.github.tomakehurst.wiremock.client.WireMock.* -import static org.mockito.Mockito.mock -import static org.mockito.Mockito.times -import static org.mockito.Mockito.when - -@RunWith(MockitoJUnitRunner.class) -@Ignore -class GenericGetVnfTest { - - def prefix = "GENGV_" - - @Rule - public WireMockRule wireMockRule = new WireMockRule(28090) - - @Captor - static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - @Test - public void testGetVnfByName() { - - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090") - when(mockExecution.getVariable(prefix+"vnfName")).thenReturn("genricVnf_test") - when(mockExecution.getVariable(prefix+"type")).thenReturn("generic-vnf") - when(mockExecution.getVariable("mso.workflow.DoCreateVfModule.aai.generic-vnf.uri")).thenReturn("/aai/v9/network/generic-vnfs/generic-vnf") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - - mockData() - GenericGetVnf obj = new GenericGetVnf() - obj.getVnfByName(mockExecution) - - Mockito.verify(mockExecution).setVariable("prefix","GENGV_") - Mockito.verify(mockExecution).setVariable(prefix+"getVnfPath","http://localhost:28090/aai/v9/network/generic-vnfs/generic-vnf?vnf-name=genricVnf_test&depth=1") - } - - @Test - public void testGetVnfByNameEndpointNull() { - - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("aai.endpoint")).thenReturn(null) - when(mockExecution.getVariable(prefix+"vnfName")).thenReturn("genricVnf_test") - when(mockExecution.getVariable(prefix+"type")).thenReturn("generic-vnf") - when(mockExecution.getVariable("mso.workflow.DoCreateVfModule.aai.generic-vnf.uri")).thenReturn("/aai/v9/network/generic-vnfs/generic-vnf") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - - mockData() - try{ - GenericGetVnf obj = new GenericGetVnf() - obj.getVnfByName(mockExecution) - }catch (Exception ex) { - println " Test End - Handle catch-throw BpmnError()! " - } - - Mockito.verify(mockExecution, times(3)).setVariable(captor.capture(), captor.capture()) - WorkflowException workflowException = captor.getValue() - Assert.assertEquals(9999, workflowException.getErrorCode()) - Assert.assertEquals("org.apache.http.client.ClientProtocolException", workflowException.getErrorMessage()) - } - - @Test - public void testGetVnfById() { - - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090") - when(mockExecution.getVariable(prefix+"vnfId")).thenReturn("genricVnf_test") - when(mockExecution.getVariable(prefix+"type")).thenReturn("generic-vnf") - when(mockExecution.getVariable("mso.workflow.DoCreateVfModule.aai.generic-vnf.uri")).thenReturn("/aai/v9/network/generic-vnfs/generic-vnf") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - - mockData() - GenericGetVnf obj = new GenericGetVnf() - obj.getVnfById(mockExecution) - - Mockito.verify(mockExecution).setVariable("prefix","GENGV_") - Mockito.verify(mockExecution).setVariable(prefix+"getVnfPath","http://localhost:28090/aai/v9/network/generic-vnfs/generic-vnf/genricVnf_test?depth=1") - } - - @Test - public void testGetVnfByIdEndpointNull() { - - ExecutionEntity mockExecution = setupMock() - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("aai.endpoint")).thenReturn(null) - when(mockExecution.getVariable(prefix+"vnfId")).thenReturn("genricVnf_test") - when(mockExecution.getVariable(prefix+"type")).thenReturn("generic-vnf") - when(mockExecution.getVariable("mso.workflow.DoCreateVfModule.aai.generic-vnf.uri")).thenReturn("/aai/v9/network/generic-vnfs/generic-vnf") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/") - - mockData() - try{ - GenericGetVnf obj = new GenericGetVnf() - obj.getVnfById(mockExecution) - }catch (Exception ex) { - println " Test End - Handle catch-throw BpmnError()! " - } - - Mockito.verify(mockExecution, times(3)).setVariable(captor.capture(), captor.capture()) - WorkflowException workflowException = captor.getValue() - Assert.assertEquals(9999, workflowException.getErrorCode()) - Assert.assertEquals("org.apache.http.client.ClientProtocolException", workflowException.getErrorMessage()) - } - - private static ExecutionEntity setupMock() { - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoCreateVfModule") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoCreateVfModule") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoCreateVfModule") - when(mockExecution.getProcessInstanceId()).thenReturn("DoCreateVfModule") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - - private static void mockData() { - stubFor(get(urlMatching(".*/aai/v[0-9]+/network/generic-vnfs/generic-vnf.*")) - .willReturn(aResponse() - .withStatus(200).withHeader("Content-Type", "text/xml") - .withBodyFile("GenericFlows/getGenericVnfResponse.xml"))) - } -} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericPutServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericPutServiceTest.groovy deleted file mode 100644 index d4ea8ce71f..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenericPutServiceTest.groovy +++ /dev/null @@ -1,235 +0,0 @@ -/*- - * ============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.scripts - -import static org.mockito.Mockito.* -import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutServiceInstance; - -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.junit.Before -import org.junit.Ignore -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner - -import com.github.tomakehurst.wiremock.client.WireMock -import com.github.tomakehurst.wiremock.junit.WireMockRule -import org.apache.commons.lang3.* - -@RunWith(MockitoJUnitRunner.class) -@Ignore -class GenericPutServiceTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - - } - - @Test - public void preProcessRequest() { - - - println "************ preProcessRequest ************* " - - ExecutionEntity mockExecution = setupMock() - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") - when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") - when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") - when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance") - - GenericPutService putServiceInstance= new GenericPutService() - putServiceInstance.preProcessRequest(mockExecution) - - // check the sequence of variable invocation - //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() - //preDebugger.printInvocations(mockExecution) - - verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", "GENPS_") - - // execution.getVariable("isDebugLogEnabled") - - verify(mockExecution).setVariable("GENPS_SuccessIndicator", false) - // verify(mockExecution).setVariable("globalSubscriberId", "1604-MVM-26") - // verify(mockExecution).setVariable("serviceInstanceId", "MIS%2F1604%2F0026%2FSW_INTERNET") - // verify(mockExecution).setVariable("serviceType", "SDN-ETHERNET-INTERNET") - // verify(mockExecution).setVariable("ServiceInstanceData", "f70e927b-6087-4974-9ef8-c5e4d5847ca4") - - - } - - - @Test - @Ignore - public void putServiceInstance() { - println "************ putServiceInstance ************* " - - WireMock.reset(); - - MockPutServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml"); - ExecutionEntity mockExecution = setupMock() - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") - when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") - when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") - when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090") - when(mockExecution.getVariable("mso.workflow.PutServiceInstance.aai.business.customer.uri")).thenReturn("/aai/v7/business/customers/customer") - when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance") - when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/') - when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("7") - when(mockExecution.getVariable("mso.workflow.default.aai.v7.customer.uri")).thenReturn("/aai/v7/business/customers/customer") - when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") - - GenericPutService serviceInstance= new GenericPutService() - serviceInstance.putServiceInstance(mockExecution) - - // check the sequence of variable invocation - MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() - preDebugger.printInvocations(mockExecution) - - verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", "GENPS_") - - // execution.getVariable("isDebugLogEnabled") - // verify(mockExecution).setVariable("GENPSI_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4") - - String servicePayload = """<service-instance xmlns="http://org.openecomp.aai.inventory/v7">f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance>""" as String - verify(mockExecution).setVariable("GENPS_serviceInstancePayload",servicePayload) - - String serviceAaiPath = "http://localhost:28090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET" - verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceAaiPath) - - int responseCode = 200 - verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode) - - String aaiResponse = """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> -</rest:RESTResponse>""" - - verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse) - - verify(mockExecution).setVariable("GENPS_SuccessIndicator", true) - } - - @Test - @Ignore - public void putServiceInstance_404() { - - - println "************ putServiceInstance ************* " - - WireMock.reset(); - - ExecutionEntity mockExecution = setupMock() - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") - when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") - when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") - when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090") - when(mockExecution.getVariable("mso.workflow.PutServiceInstance.aai.business.customer_uri")).thenReturn("/aai/v7/business/customers/customer") - when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") - - GenericPutService serviceInstance= new GenericPutService() - serviceInstance.putServiceInstance(mockExecution) - - // check the sequence of variable invocation - MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() - preDebugger.printInvocations(mockExecution) - - verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", "GENPS_") - - // execution.getVariable("isDebugLogEnabled") - - - verify(mockExecution).setVariable("GENPS_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4") - - String serviceInstancepayload = """<service-instance xmlns="http://org.onap.so.aai.inventory/v7">f70e927b-6087-4974-9ef8-c5e4d5847ca4 - </service-instance>""" as String - verify(mockExecution).setVariable("GENPS_serviceInstancePayload",serviceInstancepayload) - - String serviceInstanceAaiPath = "http://localhost:8090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET" - verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceInstanceAaiPath) - - int responseCode = 404 - verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode) - - String aaiResponse = "" - verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse) - - verify(mockExecution).setVariable("GENPS_SuccessIndicator", false) - - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("PutServiceInstance") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("PutServiceInstance") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("PutServiceInstance") - when(mockExecution.getProcessInstanceId()).thenReturn("PutServiceInstance") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml deleted file mode 100644 index 7c879879ef..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml +++ /dev/null @@ -1,23 +0,0 @@ -<generic-vnfs xmlns="http://com.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <resource-version>testReVer123</resource-version> - <relationship-list> - <relationship> - <related-to>nothing</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml deleted file mode 100644 index 0b5a822b68..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml +++ /dev/null @@ -1,90 +0,0 @@ -<generic-vnfs xmlns="http://com.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - <generic-vnf> - <vnf-id>802767b3-18a6-4432-96db-25522786aee0</vnf-id> - <vnf-name>ZRDM1MMSC03</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml deleted file mode 100644 index 0b5a822b68..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml +++ /dev/null @@ -1,90 +0,0 @@ -<generic-vnfs xmlns="http://com.aai.inventory/v3"> - <generic-vnf> - <vnf-id>2f1cc940-455f-4ee2-9411-a7899cd4f124</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - <generic-vnf> - <vnf-id>802767b3-18a6-4432-96db-25522786aee0</vnf-id> - <vnf-name>ZRDM1MMSC03</vnf-name> - <vnf-type>mmsc-capacity</vnf-type> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <equipment-role>vMMSC</equipment-role> - <orchestration-status>pending-create</orchestration-status> - <relationship-list> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/c597ab81-fece-49f4-a4f5-710cebb13c29/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>c597ab81-fece-49f4-a4f5-710cebb13c29</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/53956c91-6e5e-49aa-88dd-535f57e66e70/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>53956c91-6e5e-49aa-88dd-535f57e66e70</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/44e0d9e0-9334-4ec6-9344-07a96dac629f/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>44e0d9e0-9334-4ec6-9344-07a96dac629f</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>l3-network</related-to> - <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/ac49d99b-5daf-4624-9f8e-188b126ea166/</related-link> - <relationship-data> - <relationship-key>l3-network.network-id</relationship-key> - <relationship-value>ac49d99b-5daf-4624-9f8e-188b126ea166</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - <l-interfaces/> - <lag-interfaces/> - </generic-vnf> - </generic-vnfs>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml deleted file mode 100644 index d0fccd80c9..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlById.xml +++ /dev/null @@ -1,6 +0,0 @@ - <search-results xmlns="http://com.aai.inventory"> - <result-data> - <resource-type>service-instance</resource-type> - <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET</resource-link> - </result-data> - </search-results>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByName.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByName.xml deleted file mode 100644 index d0fccd80c9..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByName.xml +++ /dev/null @@ -1,6 +0,0 @@ - <search-results xmlns="http://com.aai.inventory"> - <result-data> - <resource-type>service-instance</resource-type> - <resource-link>https://aai-ext1.test.com:8443/aai/v7/business/customers/customer/SDN-ETHERNET-INTERNET/service-subscriptions/service-subscription/123456789/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET</resource-link> - </result-data> - </search-results>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByNameMultiCustomer.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByNameMultiCustomer.xml deleted file mode 100644 index fce47fcd0d..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getSIUrlByNameMultiCustomer.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<search-results xmlns="http://org.openecomp.aai.inventory/v11"> - <result-data> - <resource-type>service-instance</resource-type> - <resource-link>/aai/v11/business/customers/customer/AbcBank/service-subscriptions/service-subscription/ABC-ST/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET</resource-link> - </result-data> - <result-data> - <resource-type>service-instance</resource-type> - <resource-link>/aai/v11/business/customers/customer/XyCorporation/service-subscriptions/service-subscription/XY-ST/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET</resource-link> - </result-data> -</search-results>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml deleted file mode 100644 index e377c70474..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceInstance.xml +++ /dev/null @@ -1,30 +0,0 @@ -<service-instance> - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <resource-version>123456789</resource-version> - <relationship-list> - <relationship> - <related-to>cvlan-tag</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/port-groups/port-group/slcp1447vbc.ipag/cvlan-tags/cvlan-tag/2003/</related-link> - <relationship-data> - <relationship-key>cvlan-tag.cvlan-tag</relationship-key> - <relationship-value>2003</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>port-group.interface-id</relationship-key> - <relationship-value>slcp1447vbc.ipag</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>vce.vnf-id</relationship-key> - <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vce</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/</related-link> - <relationship-data> - <relationship-key>vce.vnf-id</relationship-key> - <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </service-instance>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceSubscription.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceSubscription.xml deleted file mode 100644 index 52e75d970a..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getServiceSubscription.xml +++ /dev/null @@ -1,34 +0,0 @@ -<service-subscription xmlns="http://com.aai.inventory"> - <service-type>SDN-ETHERNET-INTERNET</service-type> - <resource-version>1234</resource-version> - <service-instance> - <service-instance-id>MIS/1604/0026/SW_INTERNET</service-instance-id> - <resource-version>123456789</resource-version> - <relationship-list> - <relationship> - <related-to>cvlan-tag</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/port-groups/port-group/slcp1447vbc.ipag/cvlan-tags/cvlan-tag/2003/</related-link> - <relationship-data> - <relationship-key>cvlan-tag.cvlan-tag</relationship-key> - <relationship-value>2003</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>port-group.interface-id</relationship-key> - <relationship-value>slcp1447vbc.ipag</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>vce.vnf-id</relationship-key> - <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vce</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/network/vces/vce/832bace2-3fb0-49e0-a6a4-07c47223c535/</related-link> - <relationship-data> - <relationship-key>vce.vnf-id</relationship-key> - <relationship-value>832bace2-3fb0-49e0-a6a4-07c47223c535</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </service-instance> - </service-subscription>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceByNameResponse.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceByNameResponse.xml deleted file mode 100644 index b55d51971d..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceByNameResponse.xml +++ /dev/null @@ -1,97 +0,0 @@ -<vce xmlns="http://com.aai.inventory"> - <vnf-id>1936628a-d22f-4943-8587-a57bab2ece7a</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-name2>US0112SLCP1VBRT076</vnf-name2> - <vnf-type>esx-vce</vnf-type> - <prov-status>NVTPROV</prov-status> - <orchestration-status>created</orchestration-status> - <resource-version>0000020</resource-version> - <heat-stack-id>slcp1476vbc/94a3c72b-94d5-444b-9a1f-647a36c2181d</heat-stack-id> - <mso-catalog-key/> - <vpe-id>VPESAT-mtanjrsv126</vpe-id> - <ipv4-oam-address>135.21.249.160</ipv4-oam-address> - <port-groups> - <port-group> - <interface-id>slcp1476vbc.vpe</interface-id> - <neutron-network-id>e7568706-a2a9-45f8-aef8-95a0e2910953</neutron-network-id> - <neutron-network-name>dvspg-VCE_VPE-slcp1476vbc</neutron-network-name> - <interface-role>Internet</interface-role> - <port-group-name>dvspg-VCE_VPE-slcp1476vbc</port-group-name> - <resource-version>0000020</resource-version> - <switch-name>dvs-slcp1-01</switch-name> - <orchestration-status>created</orchestration-status> - <heat-stack-id>dvspg-VCE_VPE-slcp1476vbc/c1299f74-da35-4228-b1e0-d2fd07176196</heat-stack-id> - <mso-catalog-key/> - <cvlan-tags> - <cvlan-tag-entry> - <cvlan-tag>3012</cvlan-tag> - <resource-version>0000020</resource-version> - </cvlan-tag-entry> - </cvlan-tags> - </port-group> - <port-group> - <interface-id>slcp1476vbc.ipag</interface-id> - <neutron-network-id>3477ddb6-b925-4971-ab62-c84b69634c49</neutron-network-id> - <neutron-network-name>dvspg-IPAG_VCE-slcp1476vbc</neutron-network-name> - <interface-role>Customer</interface-role> - <port-group-name>dvspg-IPAG_VCE-slcp1476vbc</port-group-name> - <switch-name>dvs-slcp1-01</switch-name> - <resource-version>0000020</resource-version> - <orchestration-status>created</orchestration-status> - <heat-stack-id>dvspg-IPAG_VCE-slcp1476vbc/1e9c033a-2eef-47f5-9d48-98e0b59538e7</heat-stack-id> - <mso-catalog-key/> - <cvlan-tags> - <cvlan-tag-entry> - <cvlan-tag>2003</cvlan-tag> - <resource-version>0000020</resource-version> - </cvlan-tag-entry> - </cvlan-tags> - </port-group> - </port-groups> - <relationship-list> - <relationship> - <related-to>service-instance</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/business/customers/customer/011216-1602-SDNC001/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/SDNC%2FVLXM%2F0112001%2F%2FSW_INTERNET/</related-link> - <relationship-data> - <relationship-key>service-instance.service-instance-id</relationship-key> - <relationship-value>SDNC/VLXM/0112001//SW_INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>customer.global-customer-id</relationship-key> - <relationship-value>011216-1602-SDNC001</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vserver</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/servers/v2/3d5f3fe23821416fac2b69af65248c74/vservers/ecab47d5-3450-4507-ada9-2b3c58485c51/</related-link> - <relationship-data> - <relationship-key>vserver.vserver-id</relationship-key> - <relationship-value>ecab47d5-3450-4507-ada9-2b3c58485c51</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>3d5f3fe23821416fac2b69af65248c74</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>complex</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/cloud-infrastructure/complexes/complex/MDTWNJ21A4/</related-link> - <relationship-data> - <relationship-key>complex.physical-location-id</relationship-key> - <relationship-value>MDTWNJ21A4</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>availability-zone</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/cloud-infrastructure/availability-zones/availability-zone/slcp1-esx-az01/</related-link> - <relationship-data> - <relationship-key>availability-zone.availability-zone-name</relationship-key> - <relationship-value>slcp1-esx-az01</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </vce>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceResponse.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceResponse.xml deleted file mode 100644 index e5f98bfe33..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericFlows/getVceResponse.xml +++ /dev/null @@ -1,92 +0,0 @@ -<vce xmlns="http://com.aai.inventory"> - <vnf-id>1936628a-d22f-4943-8587-a57bab2ece7a</vnf-id> - <vnf-name>testVnfName123</vnf-name> - <vnf-name2>US0112SLCP1VBRT076</vnf-name2> - <vnf-type>esx-vce</vnf-type> - <prov-status>NVTPROV</prov-status> - <orchestration-status>created</orchestration-status> - <heat-stack-id>slcp1476vbc/94a3c72b-94d5-444b-9a1f-647a36c2181d</heat-stack-id> - <mso-catalog-key/> - <vpe-id>VPESAT-mtanjrsv126</vpe-id> - <ipv4-oam-address>135.21.249.160</ipv4-oam-address> - <port-groups> - <port-group> - <interface-id>slcp1476vbc.vpe</interface-id> - <neutron-network-id>e7568706-a2a9-45f8-aef8-95a0e2910953</neutron-network-id> - <neutron-network-name>dvspg-VCE_VPE-slcp1476vbc</neutron-network-name> - <interface-role>Internet</interface-role> - <port-group-name>dvspg-VCE_VPE-slcp1476vbc</port-group-name> - <switch-name>dvs-slcp1-01</switch-name> - <orchestration-status>created</orchestration-status> - <heat-stack-id>dvspg-VCE_VPE-slcp1476vbc/c1299f74-da35-4228-b1e0-d2fd07176196</heat-stack-id> - <mso-catalog-key/> - <cvlan-tags> - <cvlan-tag-entry> - <cvlan-tag>3012</cvlan-tag> - </cvlan-tag-entry> - </cvlan-tags> - </port-group> - <port-group> - <interface-id>slcp1476vbc.ipag</interface-id> - <neutron-network-id>3477ddb6-b925-4971-ab62-c84b69634c49</neutron-network-id> - <neutron-network-name>dvspg-IPAG_VCE-slcp1476vbc</neutron-network-name> - <interface-role>Customer</interface-role> - <port-group-name>dvspg-IPAG_VCE-slcp1476vbc</port-group-name> - <switch-name>dvs-slcp1-01</switch-name> - <orchestration-status>created</orchestration-status> - <heat-stack-id>dvspg-IPAG_VCE-slcp1476vbc/1e9c033a-2eef-47f5-9d48-98e0b59538e7</heat-stack-id> - <mso-catalog-key/> - <cvlan-tags> - <cvlan-tag-entry> - <cvlan-tag>2003</cvlan-tag> - </cvlan-tag-entry> - </cvlan-tags> - </port-group> - </port-groups> - <relationship-list> - <relationship> - <related-to>service-instance</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/business/customers/customer/011216-1602-SDNC001/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/SDNC%2FVLXM%2F0112001%2F%2FSW_INTERNET/</related-link> - <relationship-data> - <relationship-key>service-instance.service-instance-id</relationship-key> - <relationship-value>SDNC/VLXM/0112001//SW_INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>service-subscription.service-type</relationship-key> - <relationship-value>SDN-ETHERNET-INTERNET</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>customer.global-customer-id</relationship-key> - <relationship-value>011216-1602-SDNC001</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>vserver</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/servers/v2/3d5f3fe23821416fac2b69af65248c74/vservers/ecab47d5-3450-4507-ada9-2b3c58485c51/</related-link> - <relationship-data> - <relationship-key>vserver.vserver-id</relationship-key> - <relationship-value>ecab47d5-3450-4507-ada9-2b3c58485c51</relationship-value> - </relationship-data> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>3d5f3fe23821416fac2b69af65248c74</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>complex</related-to> - <related-link>https://aai-ext1.test.com:8443/aai/v2/cloud-infrastructure/complexes/complex/MDTWNJ21A4/</related-link> - <relationship-data> - <relationship-key>complex.physical-location-id</relationship-key> - <relationship-value>MDTWNJ21A4</relationship-value> - </relationship-data> - </relationship> - <relationship> - <related-to>availability-zone</related-to> - <related-link>https://aai-ext1.test..com:8443/aai/v2/cloud-infrastructure/availability-zones/availability-zone/slcp1-esx-az01/</related-link> - <relationship-data> - <relationship-key>availability-zone.availability-zone-name</relationship-key> - <relationship-value>slcp1-esx-az01</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </vce>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml deleted file mode 100644 index eedbda9343..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml +++ /dev/null @@ -1,11 +0,0 @@ -<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" - statusCode="200"> - <rest:headers> - <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/> - <rest:header name="Content-Length" value="0"/> - <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/> - <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/> - <rest:header name="Server" value="Apache-Coyote/1.1"/> - <rest:header name="Cache-Control" value="private"/> - </rest:headers> -</rest:RESTResponse>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/aaiFault.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/aaiFault.xml deleted file mode 100644 index 66ed8f5758..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/GenericPutServiceInstance/aaiFault.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<Fault> -<requestError> -<serviceException> -<messageId>SVC3002</messageId> -<text>Error writing output performing %1 on %2 (msg=%3) (ec=%4)</text> -<variables> -<variable>PUTcustomer</variable> -<variable>SubName01</variable> -<variable>Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [USSTU2CFCNC0101UJZZ01] violates a uniqueness constraint [service-instance-id]</variable> -<variable>ERR.5.4.5105</variable> -</variables> -</serviceException> -</requestError> -</Fault>
\ No newline at end of file |