Package com.xebia.lottery.ui

Source Code of com.xebia.lottery.ui.LotteryPageTestCase

package com.xebia.lottery.ui;

import static org.easymock.EasyMock.*;

import org.apache.wicket.spring.test.ApplicationContextMock;
import org.apache.wicket.util.tester.WicketTester;
import org.junit.Before;

import com.xebia.cqrs.bus.Bus;
import com.xebia.lottery.queries.LotteryQueryService;

public abstract class LotteryPageTestCase {

    protected ApplicationContextMock context;
    protected WicketTester tester;
    protected Bus bus;
    protected LotteryQueryService lotteryQueryService;

    @Before
    public void setUpLotteryPageTestCase() {
        bus = createNiceMock(Bus.class);
        lotteryQueryService = createNiceMock(LotteryQueryService.class);
       
        context = new ApplicationContextMock();
        context.putBean("bus", bus);
        context.putBean("lotteryQueryService", lotteryQueryService);

        tester = new WicketTester(new WicketApplication(context));
    }
   
    protected void replayMocks() {
        replay(bus, lotteryQueryService);
    }
   
    protected void verifyMocks() {
        verify(bus, lotteryQueryService);
    }

}
TOP

Related Classes of com.xebia.lottery.ui.LotteryPageTestCase

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.