Examples of PaymentProcessor


Examples of org.apache.webbeans.test.xml.definition.PaymentProcessor

        MockAsynchronousCreditCardPaymentProcessor ccProcessor = (MockAsynchronousCreditCardPaymentProcessor) instance;

        SystemConfig config = ccProcessor.getConfig();
        Assert.assertEquals("default", config.getValue());

        PaymentProcessor paymentProcesor = ccProcessor.getPaymentProcessor();
        Assert.assertNotNull(paymentProcesor);
    }
View Full Code Here

Examples of org.apache.webbeans.test.xml.definition.PaymentProcessor

        MockAsynchronousCreditCardPaymentProcessor ccProcessor = (MockAsynchronousCreditCardPaymentProcessor) instance;

        SystemConfig config = ccProcessor.getConfig();
        Assert.assertEquals("default", config.getValue());

        PaymentProcessor paymentProcesor = ccProcessor.getPaymentProcessor();
        Assert.assertNotNull(paymentProcesor);
    }
View Full Code Here

Examples of org.jboss.seam.example.seampay.PaymentProcessor

    static final String     ACCOUNT_NUMBER = "X12345";
    static final BigDecimal INITIAL_BALANCE = new BigDecimal("1000");

    @Test
    public void testInactive() {
        PaymentProcessor processor = new PaymentProcessor();
       
        Payment payment = createTestPayment(new BigDecimal("100"), Frequency.ONCE);
        payment.setActive(false);               
               
        assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);       
              
        processor.processPayment(payment);
       
        assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);
        assert payment.getLastPaid() == null;
    }
View Full Code Here

Examples of org.jboss.seam.example.seampay.PaymentProcessor

        assert payment.getLastPaid() == null;
    }
   
    @Test
    public void testPayOnce() {
        PaymentProcessor processor = new PaymentProcessor();
       
        Payment payment = createTestPayment(new BigDecimal("100"), Frequency.ONCE);

        assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);

        processor.processPayment(payment);
              
        assert payment.getAccount().getBalance().equals(new BigDecimal("900"));
        assert !payment.getActive();
        assert payment.getLastPaid() != null;
    }
View Full Code Here

Examples of org.jboss.seam.example.seampay.PaymentProcessor

        assert payment.getLastPaid() != null;
    }
   
    @Test
    public void testPayMultiple() {
        PaymentProcessor processor = new PaymentProcessor();
       
        Payment payment = createTestPayment(new BigDecimal("100"), Frequency.WEEKLY);

        assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);

        processor.processPayment(payment);
              
        assert payment.getAccount().getBalance().equals(new BigDecimal("900"));
        assert payment.getActive();
        assert payment.getLastPaid() != null;
       
        Date firstPayment = payment.getLastPaid();
       
        pause(); // just need to make sure we are some small time in the future
       
        processor.processPayment(payment);
    
        assert payment.getAccount().getBalance().equals(new BigDecimal("800"));
        assert payment.getActive();
        assert payment.getLastPaid().after(firstPayment);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.