Skip to content

Commit

Permalink
chore: add test failing when expected is INT8 but input is INT16
Browse files Browse the repository at this point in the history
  • Loading branch information
jeqo committed Jan 31, 2024
1 parent 99a8162 commit bef1fdd
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,24 @@ void shouldFilterOutKeyRecordsNotEqualsToId() {
.isEqualTo(record);
}

@Test
void shouldFilterOutRecordNotEqualsToIntId() {
final FilterByFieldValue<SourceRecord> filter = new FilterByFieldValue.Value<>();
filter.configure(Map.of(
"field.name", "EventId",
"field.value", "4690",
"field.value.matches", "true"
));

assertThat(filter.apply(prepareRecord(() -> "A42", () -> Map.of("EventId", 4663))))
.as("Record with id not equal to 'A132' should be filtered out")
.isNull();
final SourceRecord record = prepareRecord(() -> "A42", () -> Map.of("EventId", 4690));
assertThat(filter.apply(record))
.as("Record with id equal to '4690' should not be filtered out")
.isEqualTo(record);
}

@Test
void shouldFilterOutMapValueRecordsWithRegex() {
final FilterByFieldValue<SourceRecord> filterByFieldValue = new FilterByFieldValue.Value<>();
Expand All @@ -147,7 +165,9 @@ void shouldFilterOutMapValueRecordsWithRegex() {
configs.put("field.value.matches", "false");
filterByFieldValue.configure(configs);

assertThat(filterByFieldValue.apply(prepareRecord(() -> "A42", () -> Map.of("language", "Javascript"))))
assertThat(filterByFieldValue.apply(
prepareRecord(() -> "A42", () -> Map.of("language", "Javascript"))
))
.as("The record should be filtered out")
.isNull();
final SourceRecord record = prepareRecord(() -> "A42", () -> Map.of("language", "Rust"));
Expand Down

0 comments on commit bef1fdd

Please sign in to comment.