From: seshukm Date: Sat, 28 Oct 2017 09:54:12 +0000 (+0530) Subject: Add sendSyncError to groovy test X-Git-Tag: v1.1.0~84^2~4 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=217c9cb0f7d125153acd7bcd0abfd77fbceaf360;p=so.git Add sendSyncError to groovy test IssueId: SO-281 Change-Id: I22ff6b3bafc8d76a635ed4bd03e0088fbace5a1f Signed-off-by: seshukm --- diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy index 0b7617f00f..6d2d25ae85 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy @@ -230,7 +230,29 @@ class CreateGenericAlaCarteServiceInstanceTest { //ignore } } + + @Test + //@Ignore + public void sendSyncError() { + println "************ sendSyncError ************* " + + ExecutionEntity mockExecution = setupMock() + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true) + when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6") + when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + try{ + CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance() + CreateNetworkInstance.sendSyncError(mockExecution) + + verify(mockExecution).setVariable("prefix", Prefix) + verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "500") + }catch(Exception e){ + //ignore + } + } + private ExecutionEntity setupMock() { ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)