Skip to content

Commit

Permalink
Revert "MODSOURMAN-1022: migrate from DI_EDIFACT_RECORD_CREATED to DI…
Browse files Browse the repository at this point in the history
…_INCOMING_EDIFACT_RECORD_PARSED event (#449)" (#451)

This reverts commit 7fc897a.
  • Loading branch information
yaroslav-epam authored Nov 21, 2023
1 parent 7fc897a commit d09f801
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## 5.8.0 - Unreleased
* [MODSOURMAN-1022](https://issues.folio.org/browse/MODSOURMAN-1022) Remove step of initial saving of incoming records to SRS

## 5.7.0 - Released Poppy R2 2023
The focus of this release was to implement Vertx SFTP client for Batch Voucher Export and implement pay against previous fiscal years
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<dependency>
<groupId>org.folio</groupId>
<artifactId>data-import-processing-core</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.folio</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.folio.verticles;

import static org.folio.DataImportEventTypes.DI_INCOMING_EDIFACT_RECORD_PARSED;
import static org.folio.DataImportEventTypes.DI_EDIFACT_RECORD_CREATED;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -55,7 +55,7 @@ public void start(Promise<Void> startPromise) {
EventManager.registerKafkaEventPublisher(kafkaConfig, vertx, maxDistributionNumber);

SubscriptionDefinition subscriptionDefinition = KafkaTopicNameHelper.createSubscriptionDefinition(kafkaConfig.getEnvId(),
KafkaTopicNameHelper.getDefaultNameSpace(), DI_INCOMING_EDIFACT_RECORD_PARSED.value());
KafkaTopicNameHelper.getDefaultNameSpace(), DI_EDIFACT_RECORD_CREATED.value());

consumerWrapper = KafkaConsumerWrapper.<String, String>builder()
.context(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static org.folio.ApiTestSuite.KAFKA_ENV_VALUE;
import static org.folio.ApiTestSuite.kafkaCluster;
import static org.folio.DataImportEventTypes.DI_COMPLETED;
import static org.folio.DataImportEventTypes.DI_INCOMING_EDIFACT_RECORD_PARSED;
import static org.folio.DataImportEventTypes.DI_EDIFACT_RECORD_CREATED;
import static org.folio.DataImportEventTypes.DI_ERROR;
import static org.folio.DataImportEventTypes.DI_INVOICE_CREATED;
import static org.folio.dataimport.handlers.actions.CreateInvoiceEventHandler.INVOICE_LINES_ERRORS_KEY;
Expand Down Expand Up @@ -264,7 +264,7 @@ public void shouldCreateInvoiceAndPublishDiCompletedEvent() throws InterruptedEx
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -339,7 +339,7 @@ public void shouldMatchPoLinesByPoLineNumberAndCreateInvoiceLinesWithDescription
payloadContext.put(DATA_IMPORT_PAYLOAD_OKAPI_USER_ID, USER_ID);

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -406,7 +406,7 @@ public void shouldMatchPoLinesByRefNumberAndCreateInvoiceLinesWithDescriptionFro
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -481,7 +481,7 @@ public void shouldMatchPoLinesByPoLineNumberAndCreateInvoiceLinesWithPoLinesFund
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -548,7 +548,7 @@ public void shouldNotLinkInvoiceLinesToPoLinesWhenMultiplePoLinesAreMatchedByRef
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -608,7 +608,7 @@ public void shouldMatchPoLineByPoLineNumberAndLeaveEmptyInvoiceLineFundDistribut
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -664,7 +664,7 @@ public void shouldPublishDiErrorEventWhenHasNoSourceRecord() throws InterruptedE
addMockEntry(JOB_PROFILE_SNAPSHOTS_MOCK, profileSnapshotWrapper);

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(TENANT_ID)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -709,7 +709,7 @@ public void shouldPublishDiErrorEventWhenPostInvoiceToStorageFailed() throws Int
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(ERROR_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -762,7 +762,7 @@ public void shouldPublishDiErrorWithInvoiceLineErrorWhenOneOfInvoiceLinesCreatio
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -820,7 +820,7 @@ public void shouldPublishDiErrorWhenMappingProfileHasInvalidMappingSyntax() thro
payloadContext.put(JOB_PROFILE_SNAPSHOT_ID_KEY, profileSnapshotWrapper.getId());

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(DI_POST_INVOICE_LINES_SUCCESS_TENANT)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -854,7 +854,7 @@ public void shouldReturnTrueWhenHandlerIsEligibleForActionProfile() {
// given
ProfileSnapshotWrapper profileSnapshotWrapper = buildProfileSnapshotWrapper(jobProfile, actionProfile, mappingProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withCurrentNode(profileSnapshotWrapper.getChildSnapshotWrappers().get(0));

// when
Expand All @@ -880,7 +880,7 @@ public void shouldReturnFalseWhenHandlerIsNotEligibleForActionProfile() {
.withContent(actionProfile);

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withCurrentNode(profileSnapshotWrapper);

// when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import static org.folio.ApiTestSuite.KAFKA_ENV_VALUE;
import static org.folio.ApiTestSuite.kafkaCluster;
import static org.folio.DataImportEventTypes.DI_COMPLETED;
import static org.folio.DataImportEventTypes.DI_INCOMING_EDIFACT_RECORD_PARSED;
import static org.folio.DataImportEventTypes.DI_EDIFACT_RECORD_CREATED;
import static org.folio.DataImportEventTypes.DI_ERROR;
import static org.folio.dataimport.handlers.events.DataImportKafkaHandler.JOB_PROFILE_SNAPSHOT_ID_KEY;
import static org.folio.kafka.KafkaTopicNameHelper.getDefaultNameSpace;
Expand All @@ -21,6 +21,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.io.UnsupportedEncodingException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void setUp() {
}

@Test
public void shouldPublishDiCompletedEventWhenProcessingCoreHandlerSucceeded() throws InterruptedException {
public void shouldPublishDiCompletedEventWhenProcessingCoreHandlerSucceeded() throws InterruptedException, UnsupportedEncodingException {
// given
EventHandler mockedEventHandler = mock(EventHandler.class);
when(mockedEventHandler.isEligible(any(DataImportEventPayload.class))).thenReturn(true);
Expand All @@ -104,7 +105,7 @@ public void shouldPublishDiCompletedEventWhenProcessingCoreHandlerSucceeded() th
EventManager.registerEventHandler(mockedEventHandler);

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(TENANT_ID)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down Expand Up @@ -142,7 +143,7 @@ public void shouldPublishDiErrorEventWhenProcessingCoreHandlerFailed() throws In
EventManager.registerEventHandler(mockedEventHandler);

DataImportEventPayload dataImportEventPayload = new DataImportEventPayload()
.withEventType(DI_INCOMING_EDIFACT_RECORD_PARSED.value())
.withEventType(DI_EDIFACT_RECORD_CREATED.value())
.withTenant(TENANT_ID)
.withOkapiUrl(OKAPI_URL)
.withToken(TOKEN)
Expand Down

0 comments on commit d09f801

Please sign in to comment.