@Test public void testFindBy() { CustomerOrderPayment fb1 = createCustomerOrderPayment(new BigDecimal("123.00"), "FB1-123-45", "FB1-123-45-0", PaymentGateway.AUTH, Payment.PAYMENT_STATUS_OK); fb1 = service.create(fb1); assertTrue(fb1.getCustomerOrderPaymentId() > 0); CustomerOrderPayment fb2 = createCustomerOrderPayment(new BigDecimal("123.00"), "FB2-123-45", "FB2-123-45-0", PaymentGateway.AUTH, Payment.PAYMENT_STATUS_OK); fb2 = service.create(fb2); assertTrue(fb2.getCustomerOrderPaymentId() > 0); assertTrue(service.findPayments(null, null, (String) null, (String) null).size() >= 2); assertEquals(Payment.PAYMENT_STATUS_OK, service.findPayments(null, null, Payment.PAYMENT_STATUS_OK, null).get(0).getPaymentProcessorResult()); assertEquals(PaymentGateway.AUTH, service.findPayments(null, null, null, PaymentGateway.AUTH).get(0).getTransactionOperation()); assertEquals(fb1.getOrderNumber(), service.findPayments(fb1.getOrderNumber(), null, (String) null, (String) null).get(0).getOrderNumber()); assertEquals(fb1.getOrderShipment(), service.findPayments(null, fb1.getOrderShipment(), (String) null, (String) null).get(0).getOrderShipment()); assertEquals(fb1.getCustomerOrderPaymentId(), service.findPayments(fb1.getOrderNumber(), fb1.getOrderShipment(), Payment.PAYMENT_STATUS_OK, PaymentGateway.AUTH).get(0).getCustomerOrderPaymentId()); }
@Override public List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter) { final Pair<String, Object[]> query = findCustomerOrderPaymentQuery(false, sort, sortDescending, shops, filter); return getGenericDao().findRangeByQuery( query.getFirst(), start, offset, query.getSecond() ); }
CustomerOrderPaymentServiceImpl extends PaymentModuleGenericServiceImpl<CustomerOrderPayment> implements CustomerOrderPaymentService { @Override public List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter) { final Pair<String, Object[]> query = findCustomerOrderPaymentQuery(false, sort, sortDescending, shops, filter); return getGenericDao().findRangeByQuery( query.getFirst(), start, offset, query.getSecond() ); } }
CustomerOrderPaymentServiceImpl extends PaymentModuleGenericServiceImpl<CustomerOrderPayment> implements CustomerOrderPaymentService { @Override public List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter) { final Pair<String, Object[]> query = findCustomerOrderPaymentQuery(false, sort, sortDescending, shops, filter); return getGenericDao().findRangeByQuery( query.getFirst(), start, offset, query.getSecond() ); } CustomerOrderPaymentServiceImpl(final PaymentModuleGenericDAO<CustomerOrderPayment, Long> genericDao); }
CustomerOrderPaymentServiceImpl extends PaymentModuleGenericServiceImpl<CustomerOrderPayment> implements CustomerOrderPaymentService { @Override public List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter) { final Pair<String, Object[]> query = findCustomerOrderPaymentQuery(false, sort, sortDescending, shops, filter); return getGenericDao().findRangeByQuery( query.getFirst(), start, offset, query.getSecond() ); } CustomerOrderPaymentServiceImpl(final PaymentModuleGenericDAO<CustomerOrderPayment, Long> genericDao); @Override BigDecimal getOrderAmount(final String orderNumber); @Override List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter); @Override int findCustomerOrderPaymentCount(final Set<String> shops, final Map<String, List> filter); @Override List<CustomerOrderPayment> findPayments(final String orderNumber,
                                                   final String shipmentNumber,
                                                   final String paymentProcessorResult,
                                                   final String transactionOperation); @Override List<CustomerOrderPayment> findPayments(final String orderNumber,
                                                   final String shipmentNumber,
                                                   final String[] paymentProcessorResult,
                                                   final String[] transactionOperation); }
CustomerOrderPaymentServiceImpl extends PaymentModuleGenericServiceImpl<CustomerOrderPayment> implements CustomerOrderPaymentService { @Override public List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter) { final Pair<String, Object[]> query = findCustomerOrderPaymentQuery(false, sort, sortDescending, shops, filter); return getGenericDao().findRangeByQuery( query.getFirst(), start, offset, query.getSecond() ); } CustomerOrderPaymentServiceImpl(final PaymentModuleGenericDAO<CustomerOrderPayment, Long> genericDao); @Override BigDecimal getOrderAmount(final String orderNumber); @Override List<CustomerOrderPayment> findPayments(final int start, final int offset, final String sort, final boolean sortDescending, final Set<String> shops, final Map<String, List> filter); @Override int findCustomerOrderPaymentCount(final Set<String> shops, final Map<String, List> filter); @Override List<CustomerOrderPayment> findPayments(final String orderNumber,
                                                   final String shipmentNumber,
                                                   final String paymentProcessorResult,
                                                   final String transactionOperation); @Override List<CustomerOrderPayment> findPayments(final String orderNumber,
                                                   final String shipmentNumber,
                                                   final String[] paymentProcessorResult,
                                                   final String[] transactionOperation);  }