use of io.nem.symbol.sdk.openapi.okhttp_gson.model.ChainInfoDTO in project nem2-sdk-java by nemtech.
the class ChainRepositoryOkHttpImplTest method shouldGetBlockchainScore.
@Test
public void shouldGetBlockchainScore() throws Exception {
ChainInfoDTO dto = new ChainInfoDTO();
dto.setScoreLow(BigInteger.valueOf(1));
dto.setScoreHigh(BigInteger.valueOf(2));
dto.setHeight(BigInteger.valueOf(3));
dto.latestFinalizedBlock(new FinalizedBlockDTO().hash("abc").height(BigInteger.valueOf(6)).finalizationEpoch(7L).finalizationPoint(8L));
mockRemoteCall(dto);
ChainInfo chainInfo = repository.getChainInfo().toFuture().get();
Assertions.assertEquals((dto.getScoreLow()), chainInfo.getScoreLow());
Assertions.assertEquals((dto.getScoreHigh()), chainInfo.getScoreHigh());
Assertions.assertEquals((dto.getHeight()), chainInfo.getHeight());
Assertions.assertEquals((dto.getLatestFinalizedBlock().getFinalizationPoint()), chainInfo.getLatestFinalizedBlock().getFinalizationPoint());
Assertions.assertEquals((dto.getLatestFinalizedBlock().getHeight()), chainInfo.getLatestFinalizedBlock().getHeight());
Assertions.assertEquals((dto.getLatestFinalizedBlock().getFinalizationEpoch()), chainInfo.getLatestFinalizedBlock().getFinalizationEpoch());
Assertions.assertEquals((dto.getLatestFinalizedBlock().getHash()), chainInfo.getLatestFinalizedBlock().getHash());
}
Aggregations