Use Props factory methods in getting started tutorial (#25713)
* Use Props factory methods in getting started tutorial * deprecate Props.create without actorClass parameter, #25718
This commit is contained in:
parent
4b012cc306
commit
b89a7e5df5
17 changed files with 77 additions and 34 deletions
|
|
@ -60,14 +60,6 @@ public class JavaAPI extends JUnitSuite {
|
|||
assertNotNull(ref);
|
||||
}
|
||||
|
||||
public static Props mkProps() {
|
||||
return Props.create(new Creator<Actor>() {
|
||||
public Actor create() {
|
||||
return new JavaAPITestActor();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Props mkErasedProps() {
|
||||
return Props.create(JavaAPITestActor.class, new Creator() {
|
||||
|
|
@ -77,9 +69,13 @@ public class JavaAPI extends JUnitSuite {
|
|||
});
|
||||
}
|
||||
|
||||
public static Props mkPropsWithLambda() {
|
||||
return Props.create(JavaAPITestActor.class, JavaAPITestActor::new);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mustBeAbleToCreateActorRefFromFactory() {
|
||||
ActorRef ref = system.actorOf(mkProps());
|
||||
ActorRef ref = system.actorOf(mkPropsWithLambda());
|
||||
assertNotNull(ref);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue