Search in sources :

Example 1 with ResolutionStatementInfoDTO

use of io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementInfoDTO in project nem2-sdk-java by nemtech.

the class ReceiptRepositoryOkHttpImplTest 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.okhttp_gson.model.ResolutionStatementDTO) BigInteger(java.math.BigInteger) ResolutionStatementInfoDTO(io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementInfoDTO) AddressResolutionStatement(io.nem.symbol.sdk.model.receipt.AddressResolutionStatement) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) Test(org.junit.jupiter.api.Test)

Example 2 with ResolutionStatementInfoDTO

use of io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementInfoDTO in project nem2-sdk-java by nemtech.

the class ReceiptRepositoryOkHttpImplTest method searchMosaicResolutionStatements.

@Test
public void searchMosaicResolutionStatements() throws Exception {
    ResolutionStatementDTO statement2 = new ResolutionStatementDTO();
    ResolutionStatementInfoDTO mosaicResolutionStatement = new ResolutionStatementInfoDTO();
    mosaicResolutionStatement.setStatement(statement2);
    statement2.setUnresolved("9");
    statement2.setHeight(BigInteger.valueOf(7L));
    mockRemoteCall(toPage(mosaicResolutionStatement));
    BigInteger height = BigInteger.valueOf(10L);
    List<MosaicResolutionStatement> mosaicResolutionStatements = repository.searchMosaicResolutionStatements(new ResolutionStatementSearchCriteria().height(height)).toFuture().get().getData();
    Assertions.assertEquals(1, mosaicResolutionStatements.size());
    Assertions.assertEquals(BigInteger.valueOf(7L), mosaicResolutionStatements.get(0).getHeight());
    Assertions.assertEquals(BigInteger.valueOf(9L), mosaicResolutionStatements.get(0).getUnresolved().getId());
}
Also used : ResolutionStatementDTO(io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementDTO) BigInteger(java.math.BigInteger) ResolutionStatementInfoDTO(io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementInfoDTO) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) MosaicResolutionStatement(io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement) Test(org.junit.jupiter.api.Test)

Aggregations

ResolutionStatementSearchCriteria (io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria)2 ResolutionStatementDTO (io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementDTO)2 ResolutionStatementInfoDTO (io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementInfoDTO)2 BigInteger (java.math.BigInteger)2 Test (org.junit.jupiter.api.Test)2 Address (io.nem.symbol.sdk.model.account.Address)1 AddressResolutionStatement (io.nem.symbol.sdk.model.receipt.AddressResolutionStatement)1 MosaicResolutionStatement (io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement)1