DefaultOrderModificationDao extends AbstractItemDao implements OrderModificationDao { @Override public List<WorldpayOrderModificationModel> findUnprocessedOrderModificationsByType(final PaymentTransactionType paymentTransactionType) { validateParameterNotNull(paymentTransactionType, "Transaction type must not be null"); final FlexibleSearchQuery query = new FlexibleSearchQuery(ORDER_MODIFICATION_PROCESS_QUERY); query.addQueryParameter(PAYMENT_TRANSACTION_TYPE, paymentTransactionType.getCode()); query.addQueryParameter(PROCESSED, false); final SearchResult<WorldpayOrderModificationModel> result = search(query); return result.getResult(); }  @Override List<WorldpayOrderModificationModel> findUnprocessedOrderModificationsByType(final PaymentTransactionType paymentTransactionType); @Override List<WorldpayOrderModificationModel> findUnprocessedAndNotNotifiedOrderModificationsBeforeDate(final Date date); @Override List<WorldpayOrderModificationModel> findProcessedOrderModificationsBeforeDate(final Date date); @Override List<WorldpayOrderModificationModel> findExistingModifications(final WorldpayOrderModificationModel worldpayOrderModificationModel);  }
@Test public void testFindUnprocessedOrderModificationsByType() { final List<WorldpayOrderModificationModel> result = testObj.findUnprocessedOrderModificationsByType(AUTHORIZATION); assertTrue(result.size() == 1); assertSame(worldpayOrderModificationModelMock, result.get(0)); verify(flexibleSearchServiceMock).search(queryArgumentCaptor.capture()); final FlexibleSearchQuery queryArgumentCaptorValue = queryArgumentCaptor.getValue(); assertEquals(ORDER_MODIFICATION_PROCESS_QUERY, queryArgumentCaptorValue.getQuery()); assertEquals(AUTHORIZATION.getCode(), queryArgumentCaptorValue.getQueryParameters().get(PAYMENT_TRANSACTION_TYPE)); assertEquals(false, queryArgumentCaptorValue.getQueryParameters().get(PROCESSED)); }