use junit5 version of parameterized test (#7789)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/7799/head
Sally MacFarlane 1 month ago committed by GitHub
parent 937c25acdd
commit 1b0da83f19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java

@ -15,6 +15,7 @@
package org.hyperledger.besu;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@ -46,20 +47,14 @@ import java.util.stream.Stream;
import com.google.common.collect.Streams;
import org.apache.tuweni.bytes.Bytes;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockito.junit.jupiter.MockitoExtension;
@RunWith(Parameterized.class)
@ExtendWith(MockitoExtension.class)
public class ForkIdsNetworkConfigTest {
@Parameterized.Parameter public NetworkName chainName;
@Parameterized.Parameter(1)
public List<ForkId> expectedForkIds;
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> parameters() {
return List.of(
new Object[] {
@ -149,8 +144,8 @@ public class ForkIdsNetworkConfigTest {
final AtomicLong blockNumber = new AtomicLong();
when(mockBlockchain.getChainHeadHeader()).thenReturn(mockBlockHeader);
when(mockBlockHeader.getNumber()).thenAnswer(o -> blockNumber.get());
when(mockBlockHeader.getTimestamp()).thenAnswer(o -> blockNumber.get());
lenient().when(mockBlockHeader.getNumber()).thenAnswer(o -> blockNumber.get());
lenient().when(mockBlockHeader.getTimestamp()).thenAnswer(o -> blockNumber.get());
final ForkIdManager forkIdManager =
new ForkIdManager(

Loading…
Cancel
Save