Package com.xebia.lottery.queries

Examples of com.xebia.lottery.queries.CustomerAccountQueryResult


   
    public List<CustomerAccountQueryResult> findCustomers() {
        return simpleJdbcTemplate.query("select id, version, name, account_balance from customer order by name", new ParameterizedRowMapper<CustomerAccountQueryResult>() {

            public CustomerAccountQueryResult mapRow(ResultSet rs, int rowNum) throws SQLException {
                return new CustomerAccountQueryResult(
                        VersionedId.forSpecificVersion(UUID.fromString(rs.getString("id")), rs.getLong("version")),
                        rs.getString("name"),
                        rs.getDouble("account_balance"));
            }
        });
View Full Code Here


        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);
        assertEquals(WhenCustomerIsCreated.CUSTOMER_ID, customer.getCustomerId());
        assertEquals(WhenCustomerIsCreated.CUSTOMER_INFO.getName(), customer.getCustomerName());
        assertEquals(50.0, customer.getCurrentBalance(), 0.0);
    }
View Full Code Here

TOP

Related Classes of com.xebia.lottery.queries.CustomerAccountQueryResult

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.