use of org.junit.jupiter.params.provider.EnumSource 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 org.junit.jupiter.params.provider.EnumSource 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 org.junit.jupiter.params.provider.EnumSource in project nem2-sdk-java by nemtech.
the class TransactionRepositoryIntegrationTest method getTransaction.
@ParameterizedTest
@EnumSource(RepositoryType.class)
public void getTransaction(RepositoryType type) {
Transaction transaction = get(getTransactionRepository(type).getTransaction(TransactionGroup.CONFIRMED, transactionHash));
assertEquals(TransactionType.TRANSFER, transaction.getType());
assertEquals(transactionHash, transaction.getTransactionInfo().get().getHash().get());
}
use of org.junit.jupiter.params.provider.EnumSource in project nem2-sdk-java by nemtech.
the class ListenerIntegrationTest method getAllMultisigAddressesAndAliasesWhenBasic.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getAllMultisigAddressesAndAliasesWhenBasic(RepositoryType type) {
Account testAccount = this.helper().getTestAccount(type).getKey();
Set<NamespaceId> cosignatoryAccount1aliases = get(getRepositoryFactory(type).createNamespaceRepository().getAccountsNames(Collections.singletonList(testAccount.getAddress()))).stream().flatMap(a -> a.getNames().stream().map(NamespaceName::getNamespaceId)).collect(Collectors.toSet());
Listener listener = getRepositoryFactory(type).createListener();
final Set<UnresolvedAddress> unresolvedAddresses = get(listener.getAllMultisigAddressesAndAliases(testAccount.getAddress()));
final Set<UnresolvedAddress> expectedAddresees = Sets.newSet(testAccount.getAddress());
expectedAddresees.addAll(cosignatoryAccount1aliases);
Assertions.assertEquals(expectedAddresees, unresolvedAddresses);
}
use of org.junit.jupiter.params.provider.EnumSource in project nem2-sdk-java by nemtech.
the class ListenerIntegrationTest method shouldReturnConfirmedTransactionAddressSignerViaListener.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void shouldReturnConfirmedTransactionAddressSignerViaListener(RepositoryType type) {
Listener listener = getListener(type);
SignedTransaction signedTransaction = this.announceStandaloneTransferTransaction(type, this.getRecipient());
Observable<Transaction> confirmed = listener.confirmed(this.account.getAddress(), signedTransaction.getHash());
Transaction transaction = get(confirmed.take(1));
assertEquals(signedTransaction.getHash(), transaction.getTransactionInfo().get().getHash().get());
}
Aggregations