From 1c7b9ee675bf79c192f04d8723f3f935f8f8534c Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Thu, 19 Nov 2020 18:10:56 -0500 Subject: Use the timeout from the heat templates for Use the timeout from the heat templates for polling Removed unused imports and code from base Added to get timeout from the rest client Fixed unit test for polling to account for changes Issue-ID: SO-3397 Signed-off-by: Benjamin, Max (mb388a) Signed-off-by: Krystian Kedron Change-Id: If633f4f49d88eb797020b7d72c6edd0fbee0926c --- .../so/adapters/tasks/orchestration/PollServiceTest.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'adapters/mso-openstack-adapters/src/test/java') diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java index 60826705fd..0214fdd265 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java @@ -52,15 +52,17 @@ public class PollServiceTest { Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString); Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(false); Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123"); - Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(Stack.class), eq("CREATE_IN_PROGRESS"), eq("regionOne"), - eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false))).thenReturn(new Stack()); + Mockito.when(msoHeatUtils.pollStackForStatus(eq(118), any(Stack.class), eq("CREATE_IN_PROGRESS"), + eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false))).thenReturn(new Stack()); + Mockito.when(msoHeatUtils.getVfHeatTimeoutValue(any(), eq(false))).thenReturn(118); // Mockito.doNothing().when(msoHeatUtils).postProcessStackCreate(Mockito.any(), Mockito.any(), Mockito.any(), // Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); pollService.executeExternalTask(mockExternalTask, mockExternalTaskService); - Mockito.verify(msoHeatUtils).pollStackForStatus(eq(1), any(Stack.class), eq("CREATE_IN_PROGRESS"), + Mockito.verify(msoHeatUtils).pollStackForStatus(eq(118), any(Stack.class), eq("CREATE_IN_PROGRESS"), eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(false)); + Mockito.verify(msoHeatUtils).getVfHeatTimeoutValue(any(), eq(false)); } @@ -72,16 +74,16 @@ public class PollServiceTest { Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString); Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(true); Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123"); - Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"), + Mockito.when(msoHeatUtils.pollStackForStatus(eq(118), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(true))).thenReturn(new Stack()); Mockito.doNothing().when(msoHeatUtils).postProcessStackDelete(Mockito.any()); - + Mockito.when(msoHeatUtils.getVfHeatTimeoutValue(any(), eq(false))).thenReturn(118); pollService.executeExternalTask(mockExternalTask, mockExternalTaskService); - Mockito.verify(msoHeatUtils).pollStackForStatus(eq(1), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"), + Mockito.verify(msoHeatUtils).pollStackForStatus(eq(118), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"), eq("0422ffb57ba042c0800a29dc85ca70f8"), eq(true)); - + Mockito.verify(msoHeatUtils).getVfHeatTimeoutValue(any(), eq(false)); } } -- cgit 1.2.3-korg