DefaultWorldpayPaymentTransactionDao extends AbstractItemDao implements WorldpayPaymentTransactionDao { @Override public PaymentTransactionModel findPaymentTransactionByRequestIdFromOrdersOnly(final String requestId) { final FlexibleSearchQuery query = new FlexibleSearchQuery(QUERY_TRANSACTION_BY_REQUESTID_IN_ORDERS); query.addQueryParameter(REQUESTID, requestId); return flexibleSearchService.searchUnique(query); }  @Override List<PaymentTransactionModel> findPendingPaymentTransactions(final int waitTimeInMinutes); @Override PaymentTransactionModel findPaymentTransactionByRequestIdFromOrdersOnly(final String requestId); @Override PaymentTransactionModel findPaymentTransactionByRequestId(final String requestId); @Override List<PaymentTransactionModel> findCancellablePendingAPMPaymentTransactions(); @Override FlexibleSearchService getFlexibleSearchService(); @Override @Required void setFlexibleSearchService(final FlexibleSearchService flexibleSearchService);  }
@Test public void testFindPaymentTransactionByRequestIdFromOrdersOnly() throws Exception { final PaymentTransactionModel result = testObj.findPaymentTransactionByRequestIdFromOrdersOnly(TEST_REQUEST_ID); assertSame(paymentTransactionModelMock, result); verify(flexibleSearchServiceMock).searchUnique(queryArgumentCaptor.capture()); final FlexibleSearchQuery queryArgumentCaptorValue = queryArgumentCaptor.getValue(); assertEquals(QUERY_TRANSACTION_BY_REQUESTID_IN_ORDERS, queryArgumentCaptorValue.getQuery()); assertEquals(TEST_REQUEST_ID, queryArgumentCaptorValue.getQueryParameters().get(REQUESTID)); }