Package com.prancingdonkey.model

Examples of com.prancingdonkey.model.Order


    // ToDo something broke in 3.4 need to fix
    @Ignore
    @Test
    public void testCanEvaluateRules() throws Exception {

        Order order = new Order();

        Customer customer = new Customer();
        customer.setFirstName("John");
        customer.setLastName("Foo");
        customer.setTotalOrders(1200);
        customer.setTotalSpendForYear(new BigDecimal(50000));

        Address address = new Address();
        address.setAddress1("Foo Street");
        address.setCity("Brooklyn");
        address.setState("NY");

        customer.setAddress(address);

        customer.setBirthday(new SimpleDateFormat("dd-MM-yyyy").parse("01-01-1978"));

        order.setCustomer(customer);

        muleContext.getClient().dispatch("vm://order.processing.loyalty", order, null);
        MuleMessage response = muleContext.getClient().request("vm://loyalty",15000);
        Assert.assertNotNull(response);

        Order result = (Order) response.getPayload();
        Assert.assertEquals(2,result.getRewards().size());
    }
View Full Code Here


    @Test
    public void testCanSubmitOrder() throws Exception {

        MuleClient client = muleContext.getClient();
        Order order = new Order();
        client.dispatch("jms://order.submit", order, null);

        MuleMessage result = client.request("jms://topic:events.orders.completed", 15000);
        assertNotNull(result);
        assertTrue(result.getPayload() instanceof Order);
View Full Code Here

TOP

Related Classes of com.prancingdonkey.model.Order

Copyright © 2018 www.massapicom. 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.