Merge pull request #29926 from johanandren/wip-29904-EventSourcedBehaviorTestKit-serialization-config

EventSourcedBehaviorTestKit serialization improvements
This commit is contained in:
Patrik Nordwall 2021-01-13 17:10:51 +01:00 committed by GitHub
commit ffc356c106
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -84,6 +84,13 @@ import akka.stream.scaladsl.Sink
import EventSourcedBehaviorTestKitImpl._
private def system: ActorSystem[_] = actorTestKit.system
if (system.settings.config.getBoolean("akka.persistence.testkit.events.serialize") ||
system.settings.config.getBoolean("akka.persistence.testkit.snapshots.serialize")) {
system.log.warn(
"Persistence TestKit serialization enabled when using EventSourcedBehaviorTestKit, this is not intended. " +
"make sure you create the system used in the test with the config from EventSourcedBehaviorTestKit.config " +
"as described in the docs https://doc.akka.io/docs/akka/current/typed/persistence-testing.html#unit-testing")
}
override val persistenceTestKit: PersistenceTestKit = PersistenceTestKit(system)
persistenceTestKit.clearAll()

View file

@ -37,6 +37,7 @@ object EventSourcedBehaviorTestKit {
*/
val config: Config = ConfigFactory.parseString("""
akka.persistence.testkit.events.serialize = off
akka.persistence.testkit.snapshots.serialize = off
""").withFallback(PersistenceTestKitPlugin.config)
object SerializationSettings {