Skip to content

Commit

Permalink
Test reading unrecognised log
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Aug 13, 2024
1 parent 72b487e commit 6206a31
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,13 @@ void shouldReadCommitApplied() {
assertThat(StateStoreCommitterLogEntry.readEvent(message)).isEqualTo(
new StateStoreCommitSummary("test-table", "TestRequest", Instant.parse("2024-08-13T12:12:30Z")));
}

@Test
void shouldReadUnrecognisedLog() {
// Given
String message = "some other log";

// When / Then
assertThat(StateStoreCommitterLogEntry.readEvent(message)).isNull();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ void shouldBuildSingleRunWithOneCommit() {
List.of(new StateStoreCommitSummary("test-table", "TestRequest", Instant.parse("2024-08-13T12:12:30Z")))));
}

@Test
void shouldIgnoreUnrecognisedLog() {
// Given
add("test-logstream", "Some unknown message");

// When / Then
assertThat(builder.buildRuns()).isEmpty();
}

void add(String logStream, String message) {
builder.add(List.of(
ResultField.builder().field("@logStream").value(logStream).build(),
Expand Down

0 comments on commit 6206a31

Please sign in to comment.