Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
  • Loading branch information
bilyana-gospodinova committed Dec 12, 2024
1 parent 4c17f47 commit 2e5f39f
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ void readFromDataSourceWhenThereIsContext() {
verify(fileDataRepository, times(0)).getFileAtTimestamp(anyLong(), anyLong());
}

@Test
void readFromDataSourceWhenThereIsContextButDoesNotMatchTheKey() {
when(ContractCallContext.get().getFile()).thenReturn(Optional.of(FILE));

File result = fileReadableKVState.readFromDataSource(
FileID.newBuilder().fileNum(321L).build());

assertThat(result).isNull();
verify(fileDataRepository, times(1)).getFileAtTimestamp(anyLong(), anyLong());
}

@Test
void sizeIsAlwaysZero() {
assertThat(fileReadableKVState.size()).isZero();
Expand Down

0 comments on commit 2e5f39f

Please sign in to comment.