Search in sources :

Example 6 with FinalizedBlock

use of io.nem.symbol.sdk.model.blockchain.FinalizedBlock in project nem2-sdk-java by nemtech.

the class ListenerIntegrationTest method shouldReturnFinalizedBlock.

@ParameterizedTest
@EnumSource(RepositoryType.class)
@Disabled
void shouldReturnFinalizedBlock(RepositoryType type) {
    Listener listener = getListener(type);
    FinalizedBlock finalizedBlock1 = get(listener.finalizedBlock().take(1));
    FinalizedBlock finalizedBlock2 = get(getRepositoryFactory(type).createChainRepository().getChainInfo()).getLatestFinalizedBlock();
    assertTrue(finalizedBlock1.getHeight().intValue() > 0);
    assertEquals(finalizedBlock1, finalizedBlock2);
}
Also used : Listener(io.nem.symbol.sdk.api.Listener) FinalizedBlock(io.nem.symbol.sdk.model.blockchain.FinalizedBlock) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

FinalizedBlock (io.nem.symbol.sdk.model.blockchain.FinalizedBlock)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 EnumSource (org.junit.jupiter.params.provider.EnumSource)4 FinalizationRepository (io.nem.symbol.sdk.api.FinalizationRepository)2 RepositoryFactory (io.nem.symbol.sdk.api.RepositoryFactory)2 ListenerSubscribeMessage (io.nem.symbol.sdk.infrastructure.ListenerSubscribeMessage)2 FinalizationProof (io.nem.symbol.sdk.model.finalization.FinalizationProof)2 ArrayList (java.util.ArrayList)2 Test (org.junit.jupiter.api.Test)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 JsonObject (com.google.gson.JsonObject)1 Listener (io.nem.symbol.sdk.api.Listener)1 ChainInfo (io.nem.symbol.sdk.model.blockchain.ChainInfo)1 Disabled (org.junit.jupiter.api.Disabled)1