Search in sources :

Example 1 with LotteryTestingModule

use of com.iluwatar.hexagonal.module.LotteryTestingModule in project java-design-patterns by iluwatar.

the class App method main.

/**
 * Program entry point
 */
public static void main(String[] args) {
    Injector injector = Guice.createInjector(new LotteryTestingModule());
    // start new lottery round
    LotteryAdministration administartion = injector.getInstance(LotteryAdministration.class);
    administartion.resetLottery();
    // submit some lottery tickets
    LotteryService service = injector.getInstance(LotteryService.class);
    SampleData.submitTickets(service, 20);
    // perform lottery
    administartion.performLottery();
}
Also used : LotteryTestingModule(com.iluwatar.hexagonal.module.LotteryTestingModule) Injector(com.google.inject.Injector) LotteryAdministration(com.iluwatar.hexagonal.domain.LotteryAdministration) LotteryService(com.iluwatar.hexagonal.domain.LotteryService)

Aggregations

Injector (com.google.inject.Injector)1 LotteryAdministration (com.iluwatar.hexagonal.domain.LotteryAdministration)1 LotteryService (com.iluwatar.hexagonal.domain.LotteryService)1 LotteryTestingModule (com.iluwatar.hexagonal.module.LotteryTestingModule)1