Package com.xebia.lottery.events

Examples of com.xebia.lottery.events.CustomerCreatedEvent


        super(id);
    }
   
    public Customer(VersionedId customerId, CustomerInfo customerInfo, double initialAccountBalance) {
        super(customerId);
        apply(new CustomerCreatedEvent(customerId, customerInfo));
        apply(new CustomerBalanceChangedEvent(customerId, 0.0, initialAccountBalance, initialAccountBalance));
    }
View Full Code Here


    @Test
    public void findCustomers() {
        assertTrue(lotteryQueryService.findCustomers().isEmpty());

        customerCreatedEventHandler.handleMessage(new CustomerCreatedEvent(WhenCustomerIsCreated.CUSTOMER_ID, WhenCustomerIsCreated.CUSTOMER_INFO));
        customerBalanceChangedEventHandler.handleMessage(new CustomerBalanceChangedEvent(WhenCustomerIsCreated.CUSTOMER_ID, 0.0, 50.0, 50.0));

        List<CustomerAccountQueryResult> customers = lotteryQueryService.findCustomers();
        assertEquals(1, customers.size());
        CustomerAccountQueryResult customer = customers.get(0);
View Full Code Here

   
    @Override
    protected void given() {
        customer = new Customer(CUSTOMER_ID);
        customer.loadFromHistory(asList(
                new CustomerCreatedEvent(CUSTOMER_ID, CUSTOMER_INFO),
                new CustomerBalanceChangedEvent(CUSTOMER_ID, 0, 50, 50)));
       
        lottery = new Lottery(LOTTERY_ID);
        lottery.loadFromHistory(asList(new LotteryCreatedEvent(LOTTERY_ID, LOTTER_INFO)));
    }
View Full Code Here

        subject = new Customer(CUSTOMER_ID, CUSTOMER_INFO, 10.0);
    }

    @Test
    public void shouldRaiseCustomerCreatedEvent() {
        assertChange(subject, new CustomerCreatedEvent(CUSTOMER_ID, CUSTOMER_INFO));
    }
View Full Code Here

TOP

Related Classes of com.xebia.lottery.events.CustomerCreatedEvent

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.