He-Pin opened a new pull request, #3360: URL: https://github.com/apache/pekko/pull/3360
### Motivation `DurableStateBehavior` does not have the high-level actor-based test API that is available for `EventSourcedBehavior`. Issue #3236 requests matching Scala and Java APIs for commands, replies, state inspection, serialization verification, and restart recovery. ### Modification - Add Scala and Java `DurableStateBehaviorTestKit` APIs. - Execute commands against a real actor and return synchronous command, reply, state, and restart results. - Add configurable command, state, and reply serialization checks. - Add a null-safe internal state response while retaining the existing internal message shape for binary compatibility. - Add Scala and Java directional tests and persistence testing documentation. The implementation and public API structure are adapted from the existing `EventSourcedBehaviorTestKit` files in this repository; their Akka/Lightbend attribution headers are retained. No external code was copied. ### Result Durable state behaviors can now be tested through a high-level API in both DSLs, including recovery and serialization behavior. ### Tests - `sbt "persistence-testkit / Test / test"` — passed, 344 tests. - Focused Scala 2.13 tests — passed, 13 tests. - `sbt "++ 3.3.8" "persistence-testkit / Test / testOnly ..."` — passed, 13 tests. - `sbt +mimaReportBinaryIssues` — passed for Scala 2.13 and 3.3. - `sbt docs/paradox` — passed; only existing duplicate-anchor warnings were reported. - `sbt checkCodeStyle` — passed. - `sbt +headerCheckAll javafmtCheckAll` — passed. - `scalafmt --list --mode diff-ref=origin/main` — passed with no files listed. - `git diff --check` — passed. - Qoder stdout review — no must-fix findings after the attribution fix. - `sbt validatePullRequest` — affected suites and the new tests passed, but the aggregate exited nonzero on three unrelated baseline/platform failures: the Apple Silicon host cannot load the x86-only LevelDB JNI in `PersistentFsmToTypedMigrationSpec`; `IntegrationDocTest` references the baseline unqualified `pekko.dispatch.UnboundedMailbox`; and the cluster sharding multi-JVM perf test hits `NoSuchMethodException` for `jdk.jfr.Recording.stop()`. - `sbt sortImports` — could not complete because the existing Scalafix/scala.meta toolchain throws `NoSuchMethodError: scala.meta.package$.Input()` in unrelated modules; no generated changes were retained. ### References Fixes #3236 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
