From b3cf89a56cfeb30ec73e679927f6bcdba2702b38 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Wed, 3 May 2017 03:56:00 -0700 Subject: [MSO-8] Remove files that crash the commonBPMN Some files in commonBPMN have been removed as they prevent the war to be successfully deployed on Jboss + Remove rest interfaces files for catalog that should not be there anymore Change-Id: Iaf83f8b60610624e160feac8a96b7eaed7f161d1 Signed-off-by: Determe, Sebastien (sd378r) --- .../common/scripts/CommonExceptionUtilTest.groovy | 201 --------------------- 1 file changed, 201 deletions(-) delete mode 100644 bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CommonExceptionUtilTest.groovy (limited to 'bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso') diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CommonExceptionUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CommonExceptionUtilTest.groovy deleted file mode 100644 index abb369725e..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CommonExceptionUtilTest.groovy +++ /dev/null @@ -1,201 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - MSO - * ================================================================================ - * 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.openecomp.mso.bpmn.common.scripts - -import org.junit.Assert -import org.junit.Ignore -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - - - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Before -import org.junit.runner.RunWith -import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner -import org.openecomp.mso.bpmn.common.scripts.CommonExceptionUtil; -@RunWith(MockitoJUnitRunner.class) -import org.junit.Test - -class CommonExceptionUtilTest { - - def aotsFault =""" - xml:space - String - http://csi.att.com - - - - 400 - bad stuff - - - String - *** ERROR *** - String - String - String - String - - String - String - - String - String - String - String - - - - - - String - *** ERROR *** - String - String - String - String - String - String - String - - -""" - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - @Test - @Ignore - public void testMapAAIExceptionTCommonException() { - - - - String restFault = """ - - - -SVC3002 -Error writing output performing %1 on %2 (msg=%3) (ec=%4) - -PUTcustomer -SubName01 -Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [USSTU2CFCNC0101UJZZ01] violates a uniqueness constraint [service-instance-id] -ERR.5.4.5105 - - - - - """ - def errorString = """ - -SVC3002 -Error writing output performing %1 on %2 (msg=%3) (ec=%4) - -PUTcustomer -SubName01 -Unexpected error reading/updating database:Adding this property for key [service-instance-id] and value [USSTU2CFCNC0101UJZZ01] violates a uniqueness constraint [service-instance-id] -ERR.5.4.5105 - - -""" as String - - - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - CommonExceptionUtil util = new CommonExceptionUtil() - Assert.assertEquals(errorString, util.mapAAIExceptionTCommonException(restFault, mockExecution)) - } - - - - - @Test - public void testBuildException() { - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getVariable("prefix")).thenReturn("test_") - when(mockExecution.getVariable("test_ResponseCode")).thenReturn("400") - ArrayList msgVars = new ArrayList() - msgVars.add("var1") - msgVars.add("var2") - when(mockExecution.getVariable("test_errVariables")).thenReturn(msgVars) - - - CommonExceptionUtil util = new CommonExceptionUtil() - String msg = "Bad request" - String errorString = """ - - SVC2000 - The following service error occurred: %1. Error code is %2. - var1 - var2 - -""" - Assert.assertEquals(errorString, util.buildException(msg, mockExecution)) - } - - @Test - public void testMapAOTSExecptionToCommonException() { - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getVariable("prefix")).thenReturn("test_") - when(mockExecution.getVariable("test_ResponseCode")).thenReturn("400") - - CommonExceptionUtil util = new CommonExceptionUtil() - String errorString = """ - - SVC2000 - The following service error occurred: %1. Error code is %2. - Received error from AOTS: bad stuff - 400 - -""" - Assert.assertEquals(errorString, util.mapAOTSExecptionToCommonException(aotsFault, mockExecution)) - } - - - @Test - public void testParseError() { - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - String errorString = "The following service error occurred: %1. Error code is %2." - ArrayList msgVars = new ArrayList() - msgVars.add("var1") - msgVars.add("var2") - when(mockExecution.getVariable("prefix")).thenReturn("test_") - when(mockExecution.getVariable("test_errTxt")).thenReturn(errorString) - when(mockExecution.getVariable("test_errVariables")).thenReturn(msgVars) - - CommonExceptionUtil util = new CommonExceptionUtil() - - Assert.assertEquals("The following service error occurred: var1. Error code is var2.", util.parseError(mockExecution)) -} - - - -} -- cgit 1.2.3-korg