Skip to content

Commit

Permalink
DBZ-8453 remove duplicate enum preventing processing of deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
msillence committed Nov 26, 2024
1 parent cf43498 commit 05f2e09
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private BlockingReceiverConsumer processJournalEntries(As400Partition partition,
offsetContext, Operation.CREATE, null, dataNext, clock, connectorConfig));
}
break;
case DELETE_ROW1, DELETE_ROW2: {
case DELETE_ROW, ROLLBACK_DELETE_ROW: {
// record deleted
final Object[] dataBefore = r.decode(schema.getFileDecoder());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

public enum JournalEntryType {

ADD_ROW2("R.PT"),
ADD_ROW1("R.PX"),
ADD_ROW2("R.PT"),
AFTER_IMAGE("R.UP"),
ROLLBACK_AFTER_IMAGE("R.UR"),
BEFORE_IMAGE("R.UB"),
ROLLBACK_BEFORE_IMAGE("R.BR"),
DELETE_ROW1("R.DR"),
DELETE_ROW2("R.DL"),
DELETE_ROW("R.DL"),
ROLLBACK_DELETE_ROW("R.DR"),
FILE_CREATED("D.CT"),
FILE_CHANGE("D.CG"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.debezium.ibmi.db2.journal.retrieve;

import static org.junit.jupiter.api.Assertions.assertFalse;

import java.util.HashMap;
import java.util.Map;

import org.junit.jupiter.api.Test;

class JournalEntryTypeTest {

@Test
public void checkNoDuplicateEnums() {
Map<String, JournalEntryType> found = new HashMap<>();
for (final JournalEntryType e : JournalEntryType.values()) {
assertFalse(found.containsKey(e.code), "map must not contain duplicate values found enums " + e + ", " + found.get(e.code));
found.put(e.code, e);
}
}

}

0 comments on commit 05f2e09

Please sign in to comment.