@Test public void shouldCreateNGuestsBasedOnCount() { new JavaTestKit(system) {{ new CoffeeHouseApp(system) { @Override protected ActorRef createCoffeeHouse() { return getRef(); } }.createGuest(2, new Coffee.Akkaccino(), Integer.MAX_VALUE); expectMsgAllOf(new CoffeeHouse.CreateGuest(new Coffee.Akkaccino()), new CoffeeHouse.CreateGuest(new Coffee.Akkaccino())); }}; }
void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } }
CoffeeHouseApp implements Terminal { void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } } }
CoffeeHouseApp implements Terminal { void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } } CoffeeHouseApp(final ActorSystem system); }
CoffeeHouseApp implements Terminal { void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args); }
CoffeeHouseApp implements Terminal { void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args);  }