@Test public void sendingCoffeeServedShouldIncreaseCoffeeCount() { new JavaTestKit(system) {{ ActorRef guest = system.actorOf(Guest.props(system.deadLetters(), new Coffee.Akkaccino(), duration("100 milliseconds"))); interceptInfoLogMessage(this, ".*[Ee]njoy.*1\\.*", 1, () -> { guest.tell(new Waiter.CoffeeServed(new Coffee.Akkaccino()), ActorRef.noSender()); }); }}; }
static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); }
Guest extends AbstractLoggingActor { static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); } }
Guest extends AbstractLoggingActor { static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); } Guest(ActorRef waiter, Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration); }
Guest extends AbstractLoggingActor { static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); } Guest(ActorRef waiter, Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration); @Override Receive createReceive(); }
Guest extends AbstractLoggingActor { static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); } Guest(ActorRef waiter, Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration); @Override Receive createReceive();  }