Using the latest and greatest snapshot version 2.5-20180405-232526, I wrote a simple persistent actor. In order to test it I tried both BehaviorTestKit
and ActorTestKit
.
Using BehaviorTestKit
resulted in the following error:
com.typesafe.config.ConfigException$BadPath: path parameter: Invalid path '': path has a leading,
trailing, or two adjacent period '.' (use quoted "" empty string if you want an empty element)
com.typesafe.config.impl.PathParser.parsePathExpression(PathParser.java:170)
com.typesafe.config.impl.PathParser.parsePathExpression(PathParser.java:74)
com.typesafe.config.impl.PathParser.parsePath(PathParser.java:61)
com.typesafe.config.impl.Path.newPath(Path.java:230)
com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:192)
com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:268)
com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:274)
com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:41)
akka.persistence.typed.internal.EventsourcedSettings$.journalConfigFor(EventsourcedSettings.scal
a:67)
akka.persistence.typed.internal.EventsourcedSettingsImpl.<init>(EventsourcedSettings.scala:92)
akka.persistence.typed.internal.EventsourcedSettings$.apply(EventsourcedSettings.scala:57)
akka.persistence.typed.internal.EventsourcedSettings$.apply(EventsourcedSettings.scala:38)
akka.persistence.typed.internal.PersistentBehaviorImpl.$anonfun$apply$2(PersistentBehaviorImpl.s
cala:33)
akka.actor.typed.internal.TimerSchedulerImpl$.wrapWithTimers(TimerSchedulerImpl.scala:35)
akka.actor.typed.internal.TimerSchedulerImpl$.$anonfun$withTimers$1(TimerSchedulerImpl.scala:28)
akka.actor.typed.Behavior$DeferredBehavior$$anon$1.apply(Behavior.scala:211)
akka.actor.typed.Behavior$.start(Behavior.scala:276)
akka.actor.typed.internal.BehaviorImpl$.$anonfun$widened$1(BehaviorImpl.scala:33)
akka.actor.typed.Behavior$DeferredBehavior$$anon$1.apply(Behavior.scala:211)
akka.actor.typed.Behavior$.start(Behavior.scala:276)
akka.testkit.typed.internal.BehaviorTestKitImpl.<init>(BehaviorTestKitImpl.scala:33)
akka.testkit.typed.scaladsl.BehaviorTestKit$.apply(BehaviorTestKit.scala:17)
akka.testkit.typed.scaladsl.BehaviorTestKit$.apply(BehaviorTestKit.scala:19)
ActorTestKit
gave me the following exception:
12:22:28 ERROR OneForOneStrategy [akka://AccountsTests_/system/inmemory-snapshot-store] - cannot create top-level actor [JournalStorage] from the outside on ActorSystem with custom user guardian
akka.actor.ActorInitializationException: akka://AccountsTests_/system/inmemory-snapshot-store: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:193) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ActorCell.create(ActorCell.scala:669) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:523) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:545) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.dispatch.Mailbox.run(Mailbox.scala:224) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) ~[?:?]
at java.lang.Thread.run(Thread.java:844) ~[?:?]
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:488) ~[?:?]
at akka.util.Reflect$.instantiate(Reflect.scala:66) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.Props.newActor(Props.scala:212) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ActorCell.newActor(ActorCell.scala:624) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ActorCell.create(ActorCell.scala:650) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
... 7 more
Caused by: java.lang.UnsupportedOperationException: cannot create top-level actor [JournalStorage] from the outside on ActorSystem with custom user guardian
at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:736) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.persistence.inmemory.extension.StorageExtensionImpl.<init>(StorageExtension.scala:31) ~[akka-persistence-inmemory_2.12-2.5.1.1.jar:2.5.1.1]
at akka.persistence.inmemory.extension.StorageExtension$.createExtension(StorageExtension.scala:23) ~[akka-persistence-inmemory_2.12-2.5.1.1.jar:2.5.1.1]
at akka.persistence.inmemory.extension.StorageExtension$.createExtension(StorageExtension.scala:22) ~[akka-persistence-inmemory_2.12-2.5.1.1.jar:2.5.1.1]
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:913) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ExtensionId.apply(Extension.scala:79) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.actor.ExtensionId.apply$(Extension.scala:78) ~[akka-actor_2.12-2.5-20180405-232526.jar:2.5-20180405-232526]
at akka.persistence.inmemory.extension.StorageExtension$.apply(StorageExtension.scala:22) ~[akka-persistence-inmemory_2.12-2.5.1.1.jar:2.5.1.1]
at akka.persistence.inmemory.snapshot.InMemorySnapshotStore.<init>(InMemorySnapshotStore.scala:45) ~[akka-persistence-inmemory_2.12-2.5.1.1.jar:2.5.1.1]