use of co.rsk.net.SyncProcessor in project rskj by rsksmart.
the class SyncNotificationEmitterTest method setUp.
@Before
public void setUp() {
Ethereum ethereum = mock(Ethereum.class);
serializer = mock(JsonRpcSerializer.class);
Blockchain blockchain = mock(Blockchain.class);
Block block = mock(Block.class);
when(block.getNumber()).thenReturn(2L);
when(blockchain.getBestBlock()).thenReturn(block);
SyncProcessor syncProcessor = mock(SyncProcessor.class);
when(syncProcessor.getInitialBlockNumber()).thenReturn(2L);
when(syncProcessor.getHighestBlockNumber()).thenReturn(100L);
emitter = new SyncNotificationEmitter(ethereum, serializer, blockchain, syncProcessor);
ArgumentCaptor<EthereumListener> listenerCaptor = ArgumentCaptor.forClass(EthereumListener.class);
verify(ethereum).addListener(listenerCaptor.capture());
listener = listenerCaptor.getValue();
}
Aggregations