Search in sources :

Example 6 with AddressResolutionStatement

use of io.nem.symbol.sdk.model.receipt.AddressResolutionStatement in project nem2-sdk-java by nemtech.

the class ReceiptRepositoryVertxImplTest method searchAddressResolutionStatements.

@Test
public void searchAddressResolutionStatements() throws Exception {
    ResolutionStatementInfoDTO addressResolutionStatement = new ResolutionStatementInfoDTO();
    Address address = Address.generateRandom(this.networkType);
    ResolutionStatementDTO statement1 = new ResolutionStatementDTO();
    addressResolutionStatement.setStatement(statement1);
    statement1.setUnresolved(address.encoded());
    statement1.setHeight(BigInteger.valueOf(6L));
    mockRemoteCall(toPage(addressResolutionStatement));
    BigInteger height = BigInteger.valueOf(10L);
    List<AddressResolutionStatement> addressResolutionStatements = repository.searchAddressResolutionStatements(new ResolutionStatementSearchCriteria().height(height)).toFuture().get().getData();
    Assertions.assertEquals(1, addressResolutionStatements.size());
    Assertions.assertEquals(BigInteger.valueOf(6L), addressResolutionStatements.get(0).getHeight());
    Assertions.assertEquals(address, addressResolutionStatements.get(0).getUnresolved());
}
Also used : Address(io.nem.symbol.sdk.model.account.Address) ResolutionStatementDTO(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementDTO) BigInteger(java.math.BigInteger) ResolutionStatementInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementInfoDTO) AddressResolutionStatement(io.nem.symbol.sdk.model.receipt.AddressResolutionStatement) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) Test(org.junit.jupiter.api.Test)

Aggregations

ResolutionStatementSearchCriteria (io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria)6 AddressResolutionStatement (io.nem.symbol.sdk.model.receipt.AddressResolutionStatement)6 BigInteger (java.math.BigInteger)5 ReceiptRepository (io.nem.symbol.sdk.api.ReceiptRepository)4 Page (io.nem.symbol.sdk.api.Page)3 Address (io.nem.symbol.sdk.model.account.Address)3 MosaicResolutionStatement (io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement)3 Test (org.junit.jupiter.api.Test)3 TransactionStatementSearchCriteria (io.nem.symbol.sdk.api.TransactionStatementSearchCriteria)2 Account (io.nem.symbol.sdk.model.account.Account)2 NamespaceId (io.nem.symbol.sdk.model.namespace.NamespaceId)2 ReceiptType (io.nem.symbol.sdk.model.receipt.ReceiptType)2 TransactionStatement (io.nem.symbol.sdk.model.receipt.TransactionStatement)2 Observable (io.reactivex.Observable)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 ExceptionUtils (io.nem.symbol.core.utils.ExceptionUtils)1 StringEncoder (io.nem.symbol.core.utils.StringEncoder)1 BlockRepository (io.nem.symbol.sdk.api.BlockRepository)1 Listener (io.nem.symbol.sdk.api.Listener)1