use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionStatusRepositoryVertxImplTest method shouldGetTransactionStatus.
@Test
public void shouldGetTransactionStatus() throws Exception {
TransactionStatusDTO transactionStatusDTO = new TransactionStatusDTO();
transactionStatusDTO.setGroup(TransactionGroupEnum.FAILED);
transactionStatusDTO.setDeadline(BigInteger.valueOf(5));
transactionStatusDTO.setHeight(BigInteger.valueOf(6));
transactionStatusDTO.setCode(TransactionStatusEnum.FAILURE_ACCOUNTLINK_LINK_ALREADY_EXISTS);
transactionStatusDTO.setHash("someHash");
mockRemoteCall(transactionStatusDTO);
TransactionStatus transaction = repository.getTransactionStatus(transactionStatusDTO.getHash()).toFuture().get();
Assertions.assertNotNull(transaction);
Assertions.assertEquals(transactionStatusDTO.getHash(), transaction.getHash());
Assertions.assertEquals(5L, transaction.getDeadline().getValue());
Assertions.assertEquals(BigInteger.valueOf(6L), transaction.getHeight());
Assertions.assertEquals("Failure_AccountLink_Link_Already_Exists", transaction.getCode());
Assertions.assertEquals(transaction.getGroup().getValue(), transactionStatusDTO.getGroup().getValue());
}
Aggregations