Add sendSyncError to groovy test 31/21131/1
authorseshukm <seshu.kumar.m@huawei.com>
Sat, 28 Oct 2017 09:54:12 +0000 (15:24 +0530)
committerseshukm <seshu.kumar.m@huawei.com>
Sat, 28 Oct 2017 09:54:12 +0000 (15:24 +0530)
IssueId: SO-281

Change-Id: I22ff6b3bafc8d76a635ed4bd03e0088fbace5a1f
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericAlaCarteServiceInstanceTest.groovy

index 0b7617f..6d2d25a 100644 (file)
@@ -230,7 +230,29 @@ class CreateGenericAlaCarteServiceInstanceTest  {
                                //ignore\r
                        }\r
                }\r
+               \r
+               @Test\r
+               //@Ignore\r
+               public void sendSyncError() {\r
                        \r
+                       println "************ sendSyncError ************* "\r
+                       \r
+                       ExecutionEntity mockExecution = setupMock()\r
+                       when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")\r
+                       when(mockExecution.getVariable("isAsyncProcess")).thenReturn(true)\r
+                       when(mockExecution.getVariable("mso-request-id")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")\r
+                       when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")\r
+                       try{\r
+                               CreateNetworkInstance CreateNetworkInstance = new CreateNetworkInstance()\r
+                               CreateNetworkInstance.sendSyncError(mockExecution)\r
+\r
+                               verify(mockExecution).setVariable("prefix", Prefix)\r
+                               verify(mockExecution).setVariable("CreateNetworkInstanceResponseCode", "500")\r
+                       }catch(Exception e){\r
+                               //ignore\r
+                       }\r
+               }\r
+               \r
                private ExecutionEntity setupMock() {\r
                        \r
                        ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)\r