summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-02-17 06:18:16 +0200
committerIttay Stern <ittay.stern@att.com>2020-02-17 06:18:16 +0200
commit599bfc9cf2a435006622332f9f3e5071f64bbbd6 (patch)
tree1875e6ae905606f15260e80cf002ba1c0d3ac7b3
parent9ea739c84733dc140fd573a4eef463b3c6240598 (diff)
Fix intermittent test inProgressJobMoreThan24HoursIsFailedInVidAudit
PresetAAIGetCloudOwnersByCloudRegionId were missing. Issue-ID: VID-647 Change-Id: I4dab07b328ef3ac7242eec22a3ef014ad87f8885 Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rw-r--r--vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java1
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationMacroApiTest.java9
2 files changed, 8 insertions, 2 deletions
diff --git a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java
index 66cdee374..4475c366b 100644
--- a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java
+++ b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java
@@ -552,6 +552,7 @@ public class AsyncInstantiationBase extends BaseMsoApiTest {
ImmutableList<BasePreset> presets = new ImmutableList.Builder<BasePreset>()
.add(new PresetGetSessionSlotCheckIntervalGet())
.add(new PresetAAIGetSubscribersGet())
+ .add(PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN3_TO_ATT_SABABA, PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MDT1_TO_ATT_NC)
.addAll(msoBulkPresets)
.addAll(customPresets)
.build();
diff --git a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationMacroApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationMacroApiTest.java
index 538a4d03a..5abc9a865 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationMacroApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationMacroApiTest.java
@@ -18,6 +18,7 @@ import static vid.automation.test.infra.Features.FLAG_1906_INSTANTIATION_API_USE
import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets;
import static vid.automation.test.utils.ExtendedHamcrestMatcher.hasItemsFromCollection;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.Arrays;
@@ -300,12 +301,14 @@ public class AsyncInstantiationMacroApiTest extends AsyncInstantiationBase {
}
@Test
- public void inProgressJobMoreThan24HoursIsFailedInVidAudit(){
+ public void inProgressJobMoreThan24HoursIsFailedInVidAudit() throws JsonProcessingException {
addBulkPendingWithCustomList(Collections.singletonList(new PresetMSOOrchestrationRequestGet("IN_PROGRESS",24)));
AtomicReference<ServiceInfo> inProgressJob = new AtomicReference<>();
+ AtomicReference<List<ServiceInfo>> serviceInfoRef = new AtomicReference<>();
boolean isJobFound = Wait.waitFor(x->{
List<ServiceInfo> serviceInfoList = serviceListCall().getBody();
+ serviceInfoRef.set(serviceInfoList);
inProgressJob.set(serviceInfoList.stream().
filter(serviceInfo -> serviceInfo.serviceInstanceId.equals(PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID) && serviceInfo.jobStatus.equals(JobStatus.FAILED))
.findFirst()
@@ -313,7 +316,9 @@ public class AsyncInstantiationMacroApiTest extends AsyncInstantiationBase {
return inProgressJob.get() != null;
}, null, 15, 1);
- org.junit.Assert.assertTrue("Job with DEFAULT_SERVICE_INSTANCE_ID and status FAILED should present", isJobFound);
+ org.junit.Assert.assertTrue(
+ "Job with DEFAULT_SERVICE_INSTANCE_ID=" + PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID
+ + " and status FAILED should present: " + objectMapper.writeValueAsString(serviceInfoRef.get()), isJobFound);
verifyAuditStatuses(inProgressJob.get().jobId, Arrays.asList(JobStatus.PENDING.name(), JobStatus.IN_PROGRESS.name(),JobStatus.FAILED.name()), JobAuditStatus.SourceStatus.VID);
verifyAuditStatuses(inProgressJob.get().jobId, Arrays.asList("REQUESTED", "IN_PROGRESS"), JobAuditStatus.SourceStatus.MSO);