|
|
|
@ -24,7 +24,6 @@ import static org.mockito.ArgumentMatchers.anyLong; |
|
|
|
|
import static org.mockito.ArgumentMatchers.anyString; |
|
|
|
|
import static org.mockito.ArgumentMatchers.eq; |
|
|
|
|
import static org.mockito.Mockito.atLeast; |
|
|
|
|
import static org.mockito.Mockito.doReturn; |
|
|
|
|
import static org.mockito.Mockito.lenient; |
|
|
|
|
import static org.mockito.Mockito.verify; |
|
|
|
|
import static org.mockito.Mockito.when; |
|
|
|
@ -43,7 +42,6 @@ import org.hyperledger.besu.cli.options.unstable.EthProtocolOptions; |
|
|
|
|
import org.hyperledger.besu.cli.options.unstable.MetricsCLIOptions; |
|
|
|
|
import org.hyperledger.besu.cli.options.unstable.NetworkingOptions; |
|
|
|
|
import org.hyperledger.besu.cli.options.unstable.SynchronizerOptions; |
|
|
|
|
import org.hyperledger.besu.components.BesuComponent; |
|
|
|
|
import org.hyperledger.besu.config.GenesisConfigOptions; |
|
|
|
|
import org.hyperledger.besu.controller.BesuController; |
|
|
|
|
import org.hyperledger.besu.controller.BesuControllerBuilder; |
|
|
|
@ -256,10 +254,8 @@ public abstract class CommandTestAbstract { |
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
public void initMocks() throws Exception { |
|
|
|
|
// doReturn used because of generic BesuController
|
|
|
|
|
doReturn(mockControllerBuilder) |
|
|
|
|
.when(mockControllerBuilderFactory) |
|
|
|
|
.fromEthNetworkConfig(any(), any()); |
|
|
|
|
when(mockControllerBuilderFactory.fromEthNetworkConfig(any(), any())) |
|
|
|
|
.thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.synchronizerConfiguration(any())).thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.ethProtocolConfiguration(any())).thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.transactionPoolConfiguration(any())) |
|
|
|
@ -288,14 +284,12 @@ public abstract class CommandTestAbstract { |
|
|
|
|
when(mockControllerBuilder.maxPeers(anyInt())).thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.maxRemotelyInitiatedPeers(anyInt())) |
|
|
|
|
.thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.besuComponent(any(BesuComponent.class))) |
|
|
|
|
.thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.besuComponent(any())).thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.cacheLastBlocks(any())).thenReturn(mockControllerBuilder); |
|
|
|
|
when(mockControllerBuilder.genesisStateHashCacheEnabled(any())) |
|
|
|
|
.thenReturn(mockControllerBuilder); |
|
|
|
|
|
|
|
|
|
// doReturn used because of generic BesuController
|
|
|
|
|
doReturn(mockController).when(mockControllerBuilder).build(); |
|
|
|
|
when(mockControllerBuilder.build()).thenReturn(mockController); |
|
|
|
|
lenient().when(mockController.getProtocolManager()).thenReturn(mockEthProtocolManager); |
|
|
|
|
lenient().when(mockController.getProtocolSchedule()).thenReturn(mockProtocolSchedule); |
|
|
|
|
lenient().when(mockController.getProtocolContext()).thenReturn(mockProtocolContext); |
|
|
|
|