From 217c9cb0f7d125153acd7bcd0abfd77fbceaf360 Mon Sep 17 00:00:00 2001 From: seshukm Date: Sat, 28 Oct 2017 15:24:12 +0530 Subject: Add sendSyncError to groovy test IssueId: SO-281 Change-Id: I22ff6b3bafc8d76a635ed4bd03e0088fbace5a1f Signed-off-by: seshukm --- ...CreateGenericAlaCarteServiceInstanceTest.groovy | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'bpmn/MSOInfrastructureBPMN/src/test/groovy/org') 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) -- cgit 1.2.3-korg