Search in sources :

Example 1 with TestHelperVertx.loadTransactionInfoDTO

use of io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method shouldGetTransactionParial.

@Test
public void shouldGetTransactionParial() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicCreationTransaction.json", TransactionInfoDTO.class);
    String hash = jsonHelper.getString(transactionInfoDTO, "meta", "hash");
    mockRemoteCall(transactionInfoDTO);
    Transaction transaction = repository.getTransaction(TransactionGroup.PARTIAL, hash).toFuture().get();
    Assertions.assertNotNull(transaction);
    Assertions.assertEquals(hash, transaction.getTransactionInfo().get().getHash().get());
    Assertions.assertEquals(TransactionGroup.PARTIAL, transaction.getGroup().get());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 2 with TestHelperVertx.loadTransactionInfoDTO

use of io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method shouldGetTransactionUnconfirmed.

@Test
public void shouldGetTransactionUnconfirmed() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicCreationTransaction.json", TransactionInfoDTO.class);
    String hash = jsonHelper.getString(transactionInfoDTO, "meta", "hash");
    mockRemoteCall(transactionInfoDTO);
    Transaction transaction = repository.getTransaction(TransactionGroup.UNCONFIRMED, hash).toFuture().get();
    Assertions.assertNotNull(transaction);
    Assertions.assertEquals(hash, transaction.getTransactionInfo().get().getHash().get());
    Assertions.assertEquals(TransactionGroup.UNCONFIRMED, transaction.getGroup().get());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 3 with TestHelperVertx.loadTransactionInfoDTO

use of io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method shouldGetTransactionsConfirmed.

@Test
public void shouldGetTransactionsConfirmed() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicCreationTransaction.json", TransactionInfoDTO.class);
    String hash = jsonHelper.getString(transactionInfoDTO, "meta", "hash");
    mockRemoteCall(Collections.singletonList(transactionInfoDTO));
    Transaction transaction = repository.getTransactions(TransactionGroup.CONFIRMED, Collections.singletonList(hash)).toFuture().get().get(0);
    Assertions.assertNotNull(transaction);
    Assertions.assertEquals(hash, transaction.getTransactionInfo().get().getHash().get());
    Assertions.assertEquals(TransactionGroup.CONFIRMED, transaction.getGroup().get());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 4 with TestHelperVertx.loadTransactionInfoDTO

use of io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method shouldGetTransactionConfirmed.

@Test
public void shouldGetTransactionConfirmed() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicCreationTransaction.json", TransactionInfoDTO.class);
    String hash = jsonHelper.getString(transactionInfoDTO, "meta", "hash");
    mockRemoteCall(transactionInfoDTO);
    Transaction transaction = repository.getTransaction(TransactionGroup.CONFIRMED, hash).toFuture().get();
    Assertions.assertNotNull(transaction);
    Assertions.assertEquals(hash, transaction.getTransactionInfo().get().getHash().get());
    Assertions.assertEquals(TransactionGroup.CONFIRMED, transaction.getGroup().get());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 5 with TestHelperVertx.loadTransactionInfoDTO

use of io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method shouldGetTransactionPartial.

@Test
public void shouldGetTransactionPartial() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicCreationTransaction.json", TransactionInfoDTO.class);
    String hash = jsonHelper.getString(transactionInfoDTO, "meta", "hash");
    mockRemoteCall(transactionInfoDTO);
    Transaction transaction = repository.getTransaction(TransactionGroup.PARTIAL, hash).toFuture().get();
    Assertions.assertNotNull(transaction);
    Assertions.assertEquals(hash, transaction.getTransactionInfo().get().getHash().get());
    Assertions.assertEquals(TransactionGroup.PARTIAL, transaction.getGroup().get());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Aggregations

TestHelperVertx.loadTransactionInfoDTO (io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO)5 CosignatureSignedTransaction (io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction)5 SignedTransaction (io.nem.symbol.sdk.model.transaction.SignedTransaction)5 Transaction (io.nem.symbol.sdk.model.transaction.Transaction)5 TransferTransaction (io.nem.symbol.sdk.model.transaction.TransferTransaction)5 AnnounceTransactionInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO)5 TransactionInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO)5 Test (org.junit.jupiter.api.Test)5