Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes and errorprone - update versions #5013

Merged
merged 19 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ignore mock warnings in clique tests
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
  • Loading branch information
macfarla committed Jan 28, 2023
commit ae231001c57e81c5ffa2d22a1c292f9057976a0d
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ public void insertsNoVoteWhenAtEpoch() {
CliqueExtraData.createWithoutProposerSeal(Bytes.wrap(new byte[32]), validatorList);
final Address a1 = Address.fromHexString("5");
final Address coinbase = AddressHelpers.ofValue(1);
when(validatorProvider.getVoteProviderAtHead().get().getVoteAfterBlock(any(), any()))

final VoteProvider mockVoteProvider = mock(VoteProvider.class);
when(validatorProvider.getVoteProviderAtHead()).thenReturn(Optional.of(mockVoteProvider));
when(mockVoteProvider.getVoteAfterBlock(any(), any()))
.thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1)));

final CliqueBlockCreator blockCreator =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
@SuppressWarnings("DirectInvocationOnMock")
public class CliqueMiningCoordinatorTest {

private static final Supplier<SignatureAlgorithm> SIGNATURE_ALGORITHM =
Expand All @@ -80,10 +81,10 @@ public class CliqueMiningCoordinatorTest {
@Mock private CliqueBlockMiner blockMiner;
@Mock private SyncState syncState;
@Mock private ValidatorProvider validatorProvider;
@Mock private BlockHeader blockHeader;

@BeforeEach
public void setup() {

headerTestFixture.number(1);
Block genesisBlock = createEmptyBlock(0, Hash.ZERO, proposerKeys); // not normally signed but ok
blockChain = createInMemoryBlockchain(genesisBlock);
Expand All @@ -101,7 +102,7 @@ public void outOfTurnBlockImportedDoesNotInterruptInTurnMiningOperation() {
// As the head of the blockChain is 0 (which effectively doesn't have a signer, all validators
// are able to propose.

when(blockMiner.getParentHeader()).thenReturn(blockChain.getChainHeadHeader());
when(blockMiner.getParentHeader()).thenReturn(blockHeader);

// Note also - validators is an hard-ordered LIST, thus in-turn will follow said list - block_1
// should be created by proposer.
Expand Down