diff options
Diffstat (limited to 'vid-automation/src/main/java/org')
-rw-r--r-- | vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java | 17 | ||||
-rw-r--r-- | vid-automation/src/main/java/org/onap/vid/api/CreateServiceWithFailedVnf.java | 9 |
2 files changed, 21 insertions, 5 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 f4dd6780a..e5da62adb 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 @@ -135,7 +135,8 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { } protected boolean getExpectedRetryEnabled(JobStatus jobStatus) { - return Features.FLAG_1902_RETRY_JOB.isActive() && (jobStatus==JobStatus.FAILED || jobStatus==JobStatus.COMPLETED_WITH_ERRORS); + return Features.FLAG_1902_RETRY_JOB.isActive() && (jobStatus==JobStatus.FAILED || jobStatus==JobStatus.COMPLETED_WITH_ERRORS + || jobStatus==JobStatus.FAILED_AND_PAUSED); } public List<BasePreset> getPresets(List<PresetMSOBaseDelete> presetOnDeleteList, List<PresetMSOBaseCreateInstancePost> presetOnCreateList, List<PresetMSOOrchestrationRequestGet> presetInProgressList) { @@ -203,7 +204,7 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { return ImmutableList.of( vidAuditStatus(jobId, "PENDING", false), vidAuditStatus(jobId, "IN_PROGRESS", false), - vidAuditStatus(jobId, "COMPLETED_WITH_ERRORS", true) + vidAuditStatus(jobId, "COMPLETED_WITH_ERROR", true) ); } @@ -214,7 +215,13 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { vidAuditStatus(jobId, "FAILED", true) ); } - + protected ImmutableList<JobAuditStatus> vidAuditStatusesFailedAndPaused(String jobId) { + return ImmutableList.of( + vidAuditStatus(jobId, "PENDING", false), + vidAuditStatus(jobId, "IN_PROGRESS", false), + vidAuditStatus(jobId, "FAILED_AND_PAUSED", true) + ); + } protected JobAuditStatus vidAuditStatus(String jobId, String jobStatus, boolean isFinal) { return new JobAuditStatus(UUID.fromString(jobId), jobStatus, JobAuditStatus.SourceStatus.VID, null, null, isFinal); } @@ -578,4 +585,8 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { org.junit.Assert.assertEquals("MSO instanceType #" + i + " is not as expected", expectedStatus.getInstanceType(), actualStatus.getInstanceType()); }); } + protected static JobStatus getErrorStatus() { + return Features.FLAG_2008_PAUSE_VFMODULE_INSTANTIATION_FAILURE.isActive() ? + JobStatus.FAILED_AND_PAUSED : JobStatus.COMPLETED_WITH_ERRORS; + } } diff --git a/vid-automation/src/main/java/org/onap/vid/api/CreateServiceWithFailedVnf.java b/vid-automation/src/main/java/org/onap/vid/api/CreateServiceWithFailedVnf.java index 30076a964..a8bcc9f75 100644 --- a/vid-automation/src/main/java/org/onap/vid/api/CreateServiceWithFailedVnf.java +++ b/vid-automation/src/main/java/org/onap/vid/api/CreateServiceWithFailedVnf.java @@ -13,6 +13,7 @@ import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaMo import org.onap.vid.model.asyncInstantiation.ServiceInfo; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import vid.automation.test.infra.Features; import vid.automation.test.infra.ModelInfo; import vid.automation.test.model.JobStatus; import vid.automation.test.model.ServiceAction; @@ -105,9 +106,13 @@ Legit Preset || deploy 1 Service, 1 VNF which will fail public void firstTimeAssertion() { assertThat(uuids, hasSize(1)); originalJobId = uuids.get(0); + boolean isPauseOnFailureFlagOn = Features.FLAG_2008_PAUSE_VFMODULE_INSTANTIATION_FAILURE.isActive(); - asyncInstantiationBase.assertServiceInfoSpecific1(originalJobId, JobStatus.COMPLETED_WITH_ERRORS, names.get(SERVICE_NAME), "us16807000", firstIds.serviceId, ServiceAction.INSTANTIATE); - asyncInstantiationBase.assertAuditStatuses(originalJobId, asyncInstantiationBase.vidAuditStatusesCompletedWithErrors(originalJobId),null); + asyncInstantiationBase.assertServiceInfoSpecific1(originalJobId, isPauseOnFailureFlagOn ? + JobStatus.FAILED_AND_PAUSED : JobStatus.COMPLETED_WITH_ERRORS, names.get(SERVICE_NAME), "us16807000", firstIds.serviceId, ServiceAction.INSTANTIATE); + asyncInstantiationBase.assertAuditStatuses(originalJobId, isPauseOnFailureFlagOn ? + asyncInstantiationBase.vidAuditStatusesFailedAndPaused(originalJobId) : + asyncInstantiationBase.vidAuditStatusesCompletedWithErrors(originalJobId),null); assertThat(SimulatorApi.retrieveRecordedRequestsPathCounter(), allOf( hasOrLacksOfEntry(createPresets.get(0).getReqPath(), 1L), hasOrLacksOfEntry(createPresets.get(1).getReqPath(), 1L), |