Skip to content

Commit

Permalink
Fix flaky test in TLVBlockFileReader
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Jul 24, 2024
1 parent 54f5f12 commit 89d5a79
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ internal class TLVBlockFileReaderTest {
testedReader.read(file = mockFile)

// Then
val expectedMessage = if (fakeDataString.length >= 2) {
"TLV header corrupt. Invalid type"
} else {
"Failed to deserialize TLV data length"
}
val captor = argumentCaptor<() -> String>()
verify(mockInternalLogger).log(
level = eq(InternalLogger.Level.WARN),
Expand All @@ -106,7 +111,7 @@ internal class TLVBlockFileReaderTest {
anyOrNull()
)
assertThat(captor.firstValue.invoke())
.startsWith("TLV header corrupt. Invalid type")
.startsWith(expectedMessage)
}

@Test
Expand Down

0 comments on commit 89d5a79

Please sign in to comment.