Merge pull request #29926 from johanandren/wip-29904-EventSourcedBehaviorTestKit-serialization-config
EventSourcedBehaviorTestKit serialization improvements
This commit is contained in:
commit
ffc356c106
2 changed files with 8 additions and 0 deletions
|
|
@ -84,6 +84,13 @@ import akka.stream.scaladsl.Sink
|
||||||
import EventSourcedBehaviorTestKitImpl._
|
import EventSourcedBehaviorTestKitImpl._
|
||||||
|
|
||||||
private def system: ActorSystem[_] = actorTestKit.system
|
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)
|
override val persistenceTestKit: PersistenceTestKit = PersistenceTestKit(system)
|
||||||
persistenceTestKit.clearAll()
|
persistenceTestKit.clearAll()
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ object EventSourcedBehaviorTestKit {
|
||||||
*/
|
*/
|
||||||
val config: Config = ConfigFactory.parseString("""
|
val config: Config = ConfigFactory.parseString("""
|
||||||
akka.persistence.testkit.events.serialize = off
|
akka.persistence.testkit.events.serialize = off
|
||||||
|
akka.persistence.testkit.snapshots.serialize = off
|
||||||
""").withFallback(PersistenceTestKitPlugin.config)
|
""").withFallback(PersistenceTestKitPlugin.config)
|
||||||
|
|
||||||
object SerializationSettings {
|
object SerializationSettings {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue