updates to groovy tests 13/105113/1
authorBoslet, Cory <cory.boslet@att.com>
Sat, 4 Apr 2020 14:46:46 +0000 (10:46 -0400)
committerBenjamin, Max (mb388a) <mb388a@att.com>
Sat, 4 Apr 2020 14:46:46 +0000 (10:46 -0400)
small updates to groovy tests

Issue-ID: SO-2789
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: Id7f809166b73c4643f06bde44b79ac407d4e148d

bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy
bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy

index 59b34c4..79b40ba 100644 (file)
@@ -57,9 +57,10 @@ abstract class MsoGroovyTest {
     protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString();
 
     protected void init(String procName){
-        mockExecution = setupMock(procName)
-        when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+        //    mockExecution = setupMock(procName)
+        //   when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
         client = mock(AAIResourcesClient.class)
+        mockExecution = mock(ExecutionEntity.class)
     }
 
     protected ExecutionEntity setupMock(String procName) {
index 99b178c..39aadd2 100644 (file)
@@ -25,7 +25,7 @@ import org.junit.rules.ExpectedException
 import static org.mockito.Mockito.*
 
 import javax.ws.rs.NotFoundException
-
+import org.camunda.bpm.engine.ProcessEngineServices
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
 import org.junit.Before
@@ -57,6 +57,7 @@ class UpdateAAIVfModuleTest  extends MsoGroovyTest {
     void init() throws IOException {
         super.init("UpdateAAIVfModule")
         when(updateAAIVfModule.getAAIClient()).thenReturn(client)
+        mockExecution = setupMock("UpdateAAIVfModule")
     }
 
     @Test
@@ -110,7 +111,7 @@ class UpdateAAIVfModuleTest  extends MsoGroovyTest {
         when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule)
         doNothing().when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject())
         updateAAIVfModule.updateVfModule(mockExecution)
-               verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200)
+        verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200)
     }
 
     @Test
@@ -126,7 +127,7 @@ class UpdateAAIVfModuleTest  extends MsoGroovyTest {
         doThrow(new NotFoundException("Vf Module not found")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject())
         thrown.expect(BpmnError.class)
         updateAAIVfModule.updateVfModule(mockExecution)
-               verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404)
+        verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404)
     }
 
 
@@ -143,7 +144,6 @@ class UpdateAAIVfModuleTest  extends MsoGroovyTest {
         doThrow(new IllegalStateException("Error in AAI client")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject())
         thrown.expect(BpmnError.class)
         updateAAIVfModule.updateVfModule(mockExecution)
-               verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500)
-
+        verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500)
     }
 }