Skip to content

Commit

Permalink
complete tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Dec 13, 2024
1 parent e42508b commit ba4f460
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tech.pegasys.teku.statetransition.blobs;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -340,11 +341,19 @@ void createAvailabilityCheckerAndValidateImmediately_shouldReturnNotRequiredWhen
when(blockBlobSidecarsTracker.add(any())).thenReturn(true);
when(blockBlobSidecarsTracker.isComplete()).thenReturn(true);

final SafeFuture<BlobSidecarsAndValidationResult> result =
SafeFuture.completedFuture(BlobSidecarsAndValidationResult.validResult(blobSidecars));
final SafeFuture<BlobSidecarsAndValidationResult> result = new SafeFuture<>();

when(forkChoiceBlobSidecarsAvailabilityChecker.getAvailabilityCheckResult()).thenReturn(result);

assertThatThrownBy(
() ->
blobSidecarManager.createAvailabilityCheckerAndValidateImmediately(
block, blobSidecars))
.isInstanceOf(IllegalStateException.class)
.hasMessage("Availability check should be done immediately");

result.complete(BlobSidecarsAndValidationResult.validResult(blobSidecars));

assertThat(
blobSidecarManager.createAvailabilityCheckerAndValidateImmediately(block, blobSidecars))
.isSameAs(result.join());
Expand Down

0 comments on commit ba4f460

Please sign in to comment.