use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionStatusRepositoryVertxImplTest method shouldGetTransactionStatuses.
@Test
public void shouldGetTransactionStatuses() 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(Collections.singletonList(transactionStatusDTO));
TransactionStatus transaction = repository.getTransactionStatuses(Collections.singletonList(transactionStatusDTO.getHash())).toFuture().get().get(0);
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());
}
use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionRepositoryIntegrationTest method getTransactionsStatuses.
@ParameterizedTest
@EnumSource(RepositoryType.class)
public void getTransactionsStatuses(RepositoryType type) {
TransactionStatusRepository transactionRepository = getTransactionStatusRepository(type);
List<TransactionStatus> transactionStatuses = get(transactionRepository.getTransactionStatuses(Collections.singletonList(transactionHash)));
assertEquals(transactionHash, transactionStatuses.get(0).getHash());
}
use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionRepositoryIntegrationTest method getTransactionStatus.
@ParameterizedTest
@EnumSource(RepositoryType.class)
public void getTransactionStatus(RepositoryType type) {
TransactionStatus transactionStatus = get(getTransactionStatusRepository(type).getTransactionStatus(transactionHash));
assertEquals(transactionHash, transactionStatus.getHash());
assertNotNull(transactionStatus.getCode());
}
use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionStatusRepositoryOkHttpImplTest 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());
}
use of io.nem.symbol.sdk.model.transaction.TransactionStatus in project nem2-sdk-java by nemtech.
the class TransactionStatusRepositoryOkHttpImplTest method shouldGetTransactionStatuses.
@Test
public void shouldGetTransactionStatuses() 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(Collections.singletonList(transactionStatusDTO));
TransactionStatus transaction = repository.getTransactionStatuses(Collections.singletonList(transactionStatusDTO.getHash())).toFuture().get().get(0);
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