@Test public void testMyFirstActor_Greeting() { final TestKit probe = new TestKit(actorSystem); final ActorRef myFirstActor = actorSystem.actorOf(MyFirstActor.props()); myFirstActor.tell(new Greeting(HELLO_WORLD), probe.getRef()); final Greeting greeting = probe.expectMsgClass(Greeting.class); assertEquals(HELLO_WORLD, greeting.getMessage()); }
static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); }
MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } }
MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); }  }
MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); }  static Props props(); @Override Receive createReceive(); }
MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); }  static Props props(); @Override Receive createReceive();  }