Skip to content

Commit 6228af3

Browse files
committed
chore: add test failing when expected is INT8 but input is INT16
1 parent 99a8162 commit 6228af3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/io/aiven/kafka/connect/transforms/FilterByFieldValueTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,24 @@ void shouldFilterOutKeyRecordsNotEqualsToId() {
138138
.isEqualTo(record);
139139
}
140140

141+
@Test
142+
void shouldFilterOutRecordNotEqualsToIntId() {
143+
final FilterByFieldValue<SourceRecord> filter = new FilterByFieldValue.Value<>();
144+
filter.configure(Map.of(
145+
"field.name", "EventId",
146+
"field.value", "4690",
147+
"field.value.matches", "true"
148+
));
149+
150+
assertThat(filter.apply(prepareRecord(() -> "A42", () -> Map.of("EventId", 4663))))
151+
.as("Record with id not equal to 'A132' should be filtered out")
152+
.isNull();
153+
final SourceRecord record = prepareRecord(() -> "A42", () -> Map.of("EventId", 4690));
154+
assertThat(filter.apply(record))
155+
.as("Record with id equal to '4690' should not be filtered out")
156+
.isEqualTo(record);
157+
}
158+
141159
@Test
142160
void shouldFilterOutMapValueRecordsWithRegex() {
143161
final FilterByFieldValue<SourceRecord> filterByFieldValue = new FilterByFieldValue.Value<>();

0 commit comments

Comments
 (0)