Skip to content

Commit

Permalink
additional test for empty optional
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Atanasov <[email protected]>
  • Loading branch information
ata-nas committed Dec 11, 2024
1 parent 4d881bd commit cd2d4af
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ void testSuccessfulBlockReadContents(final long blockNumber) throws IOException,
.containsExactlyElementsOf(blockItemUnparsed);
}

/**
* This test aims to verify that the
* {@link BlockAsLocalFileReader#read(long) correctly returns an empty
* {@link Optional} when no block file is found for the given valid block
* number.
*/
@ParameterizedTest
@MethodSource("validBlockNumbers")
void testEmptyOptWhenNoBLockFileFound(final long blockNumber) throws IOException, ParseException {
final Optional<BlockUnparsed> actual = toTest.read(blockNumber);
assertThat(actual)
.isNotNull()
.isEmpty();
}

/**
* This test aims to verify that the
* {@link BlockAsLocalFileReader#read(long)} correctly throws an
Expand Down

0 comments on commit cd2d4af

Please sign in to comment.