Package com.prancingdonkey.model

Examples of com.prancingdonkey.model.Customer


    @Override
    protected Object doTransform(Object o, String s) throws TransformerException {
        if (o instanceof Map) {

            Map payload = (Map) o;
            Customer customer = new Customer();
            String[] nameComponents = ((String) payload.get("Name")).split(" ");
            customer.setFirstName(nameComponents[0]);
            customer.setLastName(nameComponents[1]);

            return customer;
        } else {
            throw new TransformerException(this, new ClassCastException());
        }
View Full Code Here


    @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);
View Full Code Here

TOP

Related Classes of com.prancingdonkey.model.Customer

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.