use of io.nem.symbol.sdk.api.TransactionSearchCriteria in project nem2-sdk-java by nemtech.
the class TransactionSearchRepositoryIntegrationTest method searchBySignerPublicKey.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void searchBySignerPublicKey(RepositoryType type) {
TransactionRepository transactionRepository = getTransactionRepository(type);
TransactionPaginationStreamer streamer = new TransactionPaginationStreamer(transactionRepository);
Transaction transaction1 = get(streamer.search(new TransactionSearchCriteria(TransactionGroup.CONFIRMED)).take(1));
TransactionSearchCriteria criteria = new TransactionSearchCriteria(TransactionGroup.CONFIRMED);
PublicKey expectedSignerPublicKey = transaction1.getSigner().get().getPublicKey();
criteria.setSignerPublicKey(expectedSignerPublicKey);
List<Transaction> transactions = get(streamer.search(criteria).toList().toObservable());
transactions.forEach(b -> Assertions.assertEquals(expectedSignerPublicKey, b.getSigner().get().getPublicKey()));
Assertions.assertFalse(transactions.isEmpty());
helper.assertById(transactionRepository, TransactionGroup.CONFIRMED, transactions);
}
Aggregations