### Question:
TransactionRepositoryVertxImpl extends AbstractRepositoryVertxImpl implements TransactionRepository { @Override public Observable<Page<Transaction>> search(TransactionSearchCriteria criteria) { Consumer<Handler<AsyncResult<TransactionPage>>> callback = getSearchHandler(criteria); return exceptionHandling( call(callback) .map( p -> { List<Transaction> data = p.getData().stream() .map( transactionDto -> mapTransaction(criteria.getGroup(), transactionDto)) .collect(Collectors.toList()); return toPage(p.getPagination(), data); })); } TransactionRepositoryVertxImpl(ApiClient apiClient); TransactionRoutesApi getClient(); @Override Observable<Page<Transaction>> search(TransactionSearchCriteria criteria); @Override Observable<Transaction> getTransaction(TransactionGroup group, String transactionHash); @Override Observable<List<Transaction>> getTransactions(
      TransactionGroup group, List<String> transactionHashes); @Override Observable<TransactionAnnounceResponse> announce(SignedTransaction signedTransaction); @Override Observable<TransactionAnnounceResponse> announceAggregateBonded(
      SignedTransaction signedTransaction); @Override Observable<TransactionAnnounceResponse> announceAggregateBondedCosignature(
      CosignatureSignedTransaction cosignatureSignedTransaction);  }### Answer:
@Test public void searchTransactions() throws Exception { TransactionInfoDTO transferTransactionDTO = loadTransactionInfoDTO("standaloneTransferTransaction.json"); PublicAccount publicAccount = Account.generateNewAccount(networkType).getPublicAccount(); mockRemoteCall(toPage(transferTransactionDTO)); Page<Transaction> transactions = repository .search( new TransactionSearchCriteria(TransactionGroup.UNCONFIRMED) .signerPublicKey(publicAccount.getPublicKey())) .toFuture() .get(); Assertions.assertEquals(TransactionType.TRANSFER, transactions.getData().get(0).getType()); Assertions.assertEquals( TransactionGroup.UNCONFIRMED, transactions.getData().get(0).getGroup().get()); Assertions.assertEquals(1, transactions.getData().size()); Assertions.assertEquals(1, transactions.getPageNumber()); Assertions.assertEquals(2, transactions.getPageSize()); }
@Test public void searchTransactionsTransactionTypes() throws Exception { TransactionInfoDTO transferTransactionDTO = loadTransactionInfoDTO("standaloneTransferTransaction.json"); mockRemoteCall(toPage(transferTransactionDTO)); TransactionSearchCriteria criteria = new TransactionSearchCriteria(TransactionGroup.CONFIRMED) .transactionTypes( Arrays.asList( TransactionType.NAMESPACE_METADATA, TransactionType.AGGREGATE_COMPLETE)); Page<Transaction> transactions = repository.search(criteria).toFuture().get(); Assertions.assertEquals(TransactionType.TRANSFER, transactions.getData().get(0).getType()); Assertions.assertEquals( TransactionGroup.CONFIRMED, transactions.getData().get(0).getGroup().get()); Assertions.assertEquals(1, transactions.getData().size()); Assertions.assertEquals(1, transactions.getPageNumber()); Assertions.assertEquals(2, transactions.getPageSize()); }
@Test public void searchTransactionsPartial() throws Exception { TransactionInfoDTO transferTransactionDTO = loadTransactionInfoDTO("standaloneTransferTransaction.json"); PublicAccount publicAccount = Account.generateNewAccount(networkType).getPublicAccount(); mockRemoteCall(toPage(transferTransactionDTO)); Page<Transaction> transactions = repository .search( new TransactionSearchCriteria(TransactionGroup.PARTIAL) .signerPublicKey(publicAccount.getPublicKey())) .toFuture() .get(); Assertions.assertEquals(TransactionType.TRANSFER, transactions.getData().get(0).getType()); Assertions.assertEquals( TransactionGroup.PARTIAL, transactions.getData().get(0).getGroup().get()); Assertions.assertEquals(1, transactions.getData().size()); Assertions.assertEquals(1, transactions.getPageNumber()); Assertions.assertEquals(2, transactions.getPageSize()); }