From 9d8fc2f179608e5ea6b927d5bf790b24d52dc6b7 Mon Sep 17 00:00:00 2001 From: yaroslav-epam <138673581+yaroslav-epam@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:30:44 +0200 Subject: [PATCH] MODDATAIMP-957: update DI_MARC_BIB_FOR_ORDER_CREATED event to DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED (#828) --- .../verticle/DataImportConsumerVerticle.java | 4 +- .../handlers/CreateOrderEventHandlerTest.java | 52 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/org/folio/verticle/DataImportConsumerVerticle.java b/src/main/java/org/folio/verticle/DataImportConsumerVerticle.java index ffadb2739..18966acbd 100644 --- a/src/main/java/org/folio/verticle/DataImportConsumerVerticle.java +++ b/src/main/java/org/folio/verticle/DataImportConsumerVerticle.java @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.List; +import static org.folio.DataImportEventTypes.DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED; import static org.folio.DataImportEventTypes.DI_INVENTORY_INSTANCE_MATCHED; -import static org.folio.DataImportEventTypes.DI_MARC_BIB_FOR_ORDER_CREATED; import static org.folio.DataImportEventTypes.DI_ORDER_CREATED_READY_FOR_POST_PROCESSING; import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE; @@ -58,7 +58,7 @@ public class DataImportConsumerVerticle extends AbstractVerticle { public List getEvents() { return List.of( - DI_MARC_BIB_FOR_ORDER_CREATED.value(), + DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value(), DI_INVENTORY_INSTANCE_MATCHED.value(), DI_ORDER_CREATED_READY_FOR_POST_PROCESSING.value()); } diff --git a/src/test/java/org/folio/service/dataimport/handlers/CreateOrderEventHandlerTest.java b/src/test/java/org/folio/service/dataimport/handlers/CreateOrderEventHandlerTest.java index 55c71078c..a48772fed 100644 --- a/src/test/java/org/folio/service/dataimport/handlers/CreateOrderEventHandlerTest.java +++ b/src/test/java/org/folio/service/dataimport/handlers/CreateOrderEventHandlerTest.java @@ -71,8 +71,8 @@ import static org.folio.ActionProfile.FolioRecord.ITEM; import static org.folio.DataImportEventTypes.DI_COMPLETED; import static org.folio.DataImportEventTypes.DI_ERROR; +import static org.folio.DataImportEventTypes.DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED; import static org.folio.DataImportEventTypes.DI_INVENTORY_INSTANCE_MATCHED; -import static org.folio.DataImportEventTypes.DI_MARC_BIB_FOR_ORDER_CREATED; import static org.folio.DataImportEventTypes.DI_ORDER_CREATED; import static org.folio.DataImportEventTypes.DI_ORDER_CREATED_READY_FOR_POST_PROCESSING; import static org.folio.DataImportEventTypes.DI_PENDING_ORDER_CREATED; @@ -235,7 +235,7 @@ public void shouldCreatePendingOrderAndPublishDiCompletedEvent() throws Interrup DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -300,7 +300,7 @@ public void shouldCreatePendingOrderAndPublishDiCompletedEventWhenActionProfileI DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -330,7 +330,7 @@ public void shouldCreatePendingOrderAndPublishDiCompletedEventAndSetApprovedFals DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_APPROVAL_REQUIRED) .withOkapiUrl(OKAPI_URL) @@ -372,7 +372,7 @@ public void shouldCreatePendingOrderAndPublishDiReadyForPostProcessingEventWhenO addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper); DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -438,7 +438,7 @@ public void shouldCreatePendingOrderAndPublishDiPendingOrderCreatedEventWhenOpen addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper); DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -472,7 +472,7 @@ public void shouldCreatePendingOrderAndPublishDiReadyForPostProcessingEventWhenO addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper); DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -506,7 +506,7 @@ public void shouldCreatePendingOrderAndPublishDiReadyForPostProcessingEventWhenO addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper); DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_APPROVAL_REQUIRED) .withOkapiUrl(OKAPI_URL) @@ -550,7 +550,7 @@ public void shouldCreatePendingOrderAndPublishDiCompletedEventWhenOpenStatusSpec addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper); DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_APPROVAL_REQUIRED) .withOkapiUrl(OKAPI_URL) @@ -624,7 +624,7 @@ public void shouldCreatePendingOrderAndPublishDiCompletedEventWhenOpenStatusSpec DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_APPROVAL_REQUIRED) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -661,7 +661,7 @@ public void shouldCreatePendingOrderAndPublishDiReadyForPostProcessingEventWhenO DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_APPROVAL_REQUIRED) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -737,7 +737,7 @@ public void shouldPublishDiErrorEventWhenHasNoSourceRecord() throws InterruptedE DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -773,7 +773,7 @@ public void shouldCreatePoLineAndCalculateActivationDueFieldWhenActivationDueSpe DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -809,7 +809,7 @@ public void shouldCreatePoLineAndCalculateActivationDueFieldWhenActivationDueSpe DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -853,7 +853,7 @@ public void shouldOverrideConfiguredPoLinesLimitWhenPoLinesLimitSpecifiedAtMappi DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1083,7 +1083,7 @@ private DataImportEventPayload importPoLineWithCreateInventoryFieldBasedOnAction DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1124,7 +1124,7 @@ public void shouldCreateOrderWithSpecifiedAcquisitionUnitWhenUserHasUnitsAssignm DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1162,7 +1162,7 @@ public void shouldPublishDiErrorWhenMappedOrderIsInvalid() throws InterruptedExc DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1200,7 +1200,7 @@ public void shouldPublishDiErrorEventAndClearOrderIdInPoLineWhenPoLineIsInvalid( DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1237,7 +1237,7 @@ public void shouldIncrementPoLinesProgressWhenFailedToCreatePoLineAndPublishDiCo DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1277,7 +1277,7 @@ public void shouldReturnFailedByDuplicateEventExceptionFutureWhenOrderIdDuplicat DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1325,7 +1325,7 @@ record = getRecord(i); dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1417,7 +1417,7 @@ public void shouldCreatePendingOrderAndMapVendorMaterialSupplierAndAccessProvide DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1475,7 +1475,7 @@ public void shouldCreatePendingOrderAndNotMapVendorMaterialSupplierAndAccessProv DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) .withToken(TOKEN) @@ -1511,7 +1511,7 @@ public void shouldReturnFailedByDuplicateEventExceptionFutureWhenRecordIdIsDupli DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL) @@ -1542,7 +1542,7 @@ public void shouldNotReturnFailedByDuplicateEventExceptionFutureWhenRecordIdIsDi DataImportEventPayload dataImportEventPayload = new DataImportEventPayload() .withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0)) - .withEventType(DI_MARC_BIB_FOR_ORDER_CREATED.value()) + .withEventType(DI_INCOMING_MARC_BIB_FOR_ORDER_PARSED.value()) .withJobExecutionId(jobExecutionJson.getString(ID_FIELD)) .withTenant(TENANT_ID) .withOkapiUrl(OKAPI_URL)