diff --git a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala index a7fb6e6338..bc1880f0ab 100644 --- a/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala +++ b/akka-actor-testkit-typed/src/main/scala/akka/actor/testkit/typed/scaladsl/ScalaTestWithActorTestKit.scala @@ -7,10 +7,11 @@ package akka.actor.testkit.typed.scaladsl import akka.actor.testkit.typed.TestKitSettings import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest._ +import org.scalatest.{ BeforeAndAfterAll, TestSuite } import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.ScalaFutures import org.scalatest.time.Span +import org.scalatest.matchers.should.Matchers /** * A ScalaTest base class for the [[ActorTestKit]], making it possible to have ScalaTest manage the lifecycle of the testkit. diff --git a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/ActorTestKitTest.java b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/ActorTestKitTest.java index b256f0e6a1..0071f73108 100644 --- a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/ActorTestKitTest.java +++ b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/ActorTestKitTest.java @@ -9,7 +9,7 @@ import akka.actor.typed.javadsl.Behaviors; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.HashMap; import java.util.concurrent.CompletableFuture; diff --git a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/BehaviorTestKitTest.java b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/BehaviorTestKitTest.java index 4481ba7b45..22f0b16d13 100644 --- a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/BehaviorTestKitTest.java +++ b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/BehaviorTestKitTest.java @@ -13,15 +13,12 @@ import akka.actor.typed.Props; import akka.actor.typed.javadsl.Behaviors; import org.junit.Ignore; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import org.slf4j.event.Level; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Optional; -import java.util.function.Function; import java.util.stream.IntStream; import static org.junit.Assert.assertEquals; diff --git a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/LoggingTestKitTest.java b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/LoggingTestKitTest.java index 652a113f5a..22ae7c35d5 100644 --- a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/LoggingTestKitTest.java +++ b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/LoggingTestKitTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.TestException; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import org.slf4j.event.Level; import java.util.Collections; diff --git a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/TestProbeTest.java b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/TestProbeTest.java index 77cc3d39bf..6cf8c4637a 100644 --- a/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/TestProbeTest.java +++ b/akka-actor-testkit-typed/src/test/java/akka/actor/testkit/typed/javadsl/TestProbeTest.java @@ -13,7 +13,7 @@ import akka.actor.testkit.typed.scaladsl.TestProbeSpec.*; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static org.junit.Assert.*; diff --git a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/AsyncTestingExampleTest.java b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/AsyncTestingExampleTest.java index d99702a1c0..77b658b596 100644 --- a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/AsyncTestingExampleTest.java +++ b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/AsyncTestingExampleTest.java @@ -16,7 +16,7 @@ import akka.actor.testkit.typed.javadsl.ActorTestKit; import akka.actor.testkit.typed.javadsl.TestProbe; import org.junit.AfterClass; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/ManualTimerExampleTest.java b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/ManualTimerExampleTest.java index c698611abc..f5f30f1c25 100644 --- a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/ManualTimerExampleTest.java +++ b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/ManualTimerExampleTest.java @@ -12,7 +12,7 @@ import akka.actor.testkit.typed.javadsl.ManualTime; import akka.actor.testkit.typed.javadsl.TestKitJunitResource; import org.junit.ClassRule; import org.junit.Rule; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; import akka.actor.typed.javadsl.Behaviors; diff --git a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/SyncTestingExampleTest.java b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/SyncTestingExampleTest.java index 0a56cf03b9..73f9e3aa47 100644 --- a/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/SyncTestingExampleTest.java +++ b/akka-actor-testkit-typed/src/test/java/jdocs/akka/actor/testkit/typed/javadsl/SyncTestingExampleTest.java @@ -8,7 +8,6 @@ package jdocs.akka.actor.testkit.typed.javadsl; import akka.actor.testkit.typed.CapturedLogEvent; import akka.actor.testkit.typed.Effect; import akka.actor.testkit.typed.javadsl.BehaviorTestKit; -import akka.actor.testkit.typed.javadsl.Effects; import akka.actor.testkit.typed.javadsl.TestInbox; import akka.actor.typed.*; import akka.actor.typed.javadsl.*; @@ -19,7 +18,7 @@ import org.slf4j.event.Level; // #imports import org.junit.Test; import static org.junit.Assert.assertEquals; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class SyncTestingExampleTest extends JUnitSuite { diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala index 6d3c39e14f..5d8e4b7c99 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/ActorTestKitSpec.scala @@ -10,11 +10,10 @@ import scala.concurrent.Promise import akka.actor.typed.scaladsl.Behaviors import com.typesafe.config.ConfigFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpec -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } -class ActorTestKitSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class ActorTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "the Scala testkit" should { @@ -91,7 +90,7 @@ class ActorTestKitSpec extends ScalaTestWithActorTestKit with WordSpecLike with } // derivative classes should also work fine (esp the naming part -abstract class MyBaseSpec extends ScalaTestWithActorTestKit with Matchers with WordSpecLike with LogCapturing +abstract class MyBaseSpec extends ScalaTestWithActorTestKit with Matchers with AnyWordSpecLike with LogCapturing class MyConcreteDerivateSpec extends MyBaseSpec { "A derivative test" should { @@ -116,7 +115,7 @@ class MyConcreteDerivateSpec extends MyBaseSpec { } -class CompositionSpec extends WordSpec with Matchers with BeforeAndAfterAll with LogCapturing { +class CompositionSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with LogCapturing { val testKit = ActorTestKit() override def afterAll(): Unit = { diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala index e4b1a1f280..dd6e3cc114 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/BehaviorTestKitSpec.scala @@ -12,10 +12,11 @@ import akka.actor.testkit.typed.{ CapturedLogEvent, Effect } import akka.actor.testkit.typed.Effect._ import akka.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.{ Child, Parent } import akka.actor.testkit.typed.scaladsl.BehaviorTestKitSpec.Parent._ -import org.scalatest.{ Matchers, WordSpec } import scala.reflect.ClassTag import org.slf4j.event.Level +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object BehaviorTestKitSpec { object Parent { @@ -122,7 +123,7 @@ object BehaviorTestKitSpec { } -class BehaviorTestKitSpec extends WordSpec with Matchers with LogCapturing { +class BehaviorTestKitSpec extends AnyWordSpec with Matchers with LogCapturing { private val props = Props.empty.withDispatcherFromConfig("cat") diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala index a97ce6e868..11461d633f 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/LoggingEventFilterSpec.scala @@ -5,10 +5,10 @@ package akka.actor.testkit.typed.scaladsl import akka.actor.testkit.typed.LoggingEvent -import org.scalatest.WordSpecLike import org.slf4j.event.Level +import org.scalatest.wordspec.AnyWordSpecLike -class LoggingTestKitSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class LoggingTestKitSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { private class AnError extends Exception private def errorNoCause = diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestAppenderSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestAppenderSpec.scala index d09b5d2254..ca8940f813 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestAppenderSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestAppenderSpec.scala @@ -9,8 +9,8 @@ import java.util.concurrent.atomic.AtomicInteger import scala.concurrent.Future import akka.actor.testkit.typed.TestException -import org.scalatest.WordSpecLike import org.slf4j.LoggerFactory +import org.scalatest.wordspec.AnyWordSpecLike class TestAppenderSpec extends ScalaTestWithActorTestKit( @@ -18,7 +18,7 @@ class TestAppenderSpec # increase to avoid spurious failures in "find unexpected async events withOccurrences(0)" akka.actor.testkit.typed.expect-no-message-default = 1000 ms """) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { class AnotherLoggerClass diff --git a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala index 051450a528..681fc4c2a3 100644 --- a/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/akka/actor/testkit/typed/scaladsl/TestProbeSpec.scala @@ -8,9 +8,9 @@ import akka.actor.typed.scaladsl.Behaviors import com.typesafe.config.ConfigFactory import scala.concurrent.duration._ -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class TestProbeSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class TestProbeSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import TestProbeSpec._ @@ -183,7 +183,7 @@ object TestProbeSpec { class TestProbeTimeoutSpec extends ScalaTestWithActorTestKit(TestProbeSpec.timeoutConfig) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import TestProbeSpec._ diff --git a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/AsyncTestingExampleSpec.scala b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/AsyncTestingExampleSpec.scala index e846ebfa38..b588b67c25 100644 --- a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/AsyncTestingExampleSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/AsyncTestingExampleSpec.scala @@ -16,8 +16,8 @@ import akka.actor.typed.scaladsl.Behaviors import akka.util.Timeout //#test-header import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec //#test-header import scala.concurrent.duration._ @@ -60,7 +60,7 @@ object AsyncTestingExampleSpec { //#test-header class AsyncTestingExampleSpec - extends WordSpec + extends AnyWordSpec with BeforeAndAfterAll //#test-header with LogCapturing diff --git a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ManualTimerExampleSpec.scala b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ManualTimerExampleSpec.scala index 199583b4a5..2104c29156 100644 --- a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ManualTimerExampleSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ManualTimerExampleSpec.scala @@ -6,15 +6,17 @@ package docs.akka.actor.testkit.typed.scaladsl //#manual-scheduling-simple import scala.concurrent.duration._ - import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.ManualTime import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class ManualTimerExampleSpec extends ScalaTestWithActorTestKit(ManualTime.config) with WordSpecLike with LogCapturing { +class ManualTimerExampleSpec + extends ScalaTestWithActorTestKit(ManualTime.config) + with AnyWordSpecLike + with LogCapturing { val manualTime: ManualTime = ManualTime() diff --git a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ScalaTestIntegrationExampleSpec.scala b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ScalaTestIntegrationExampleSpec.scala index 199312ec4c..1cf07c89c2 100644 --- a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ScalaTestIntegrationExampleSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/ScalaTestIntegrationExampleSpec.scala @@ -11,14 +11,14 @@ import docs.akka.actor.testkit.typed.scaladsl.AsyncTestingExampleSpec.Echo import akka.actor.testkit.typed.scaladsl.LogCapturing //#scalatest-integration import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike //#scalatest-integration //#log-capturing @silent //#scalatest-integration -class ScalaTestIntegrationExampleSpec extends ScalaTestWithActorTestKit with WordSpecLike { +class ScalaTestIntegrationExampleSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike { "Something" must { "behave correctly" in { @@ -32,7 +32,7 @@ class ScalaTestIntegrationExampleSpec extends ScalaTestWithActorTestKit with Wor //#scalatest-integration //#log-capturing -class LogCapturingExampleSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class LogCapturingExampleSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Something" must { "behave correctly" in { diff --git a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala index fc40ea7b12..214dcd9d50 100644 --- a/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala +++ b/akka-actor-testkit-typed/src/test/scala/docs/akka/actor/testkit/typed/scaladsl/SyncTestingExampleSpec.scala @@ -13,8 +13,8 @@ import akka.actor.typed._ import akka.actor.typed.scaladsl._ import org.slf4j.event.Level //#imports -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object SyncTestingExampleSpec { //#child @@ -61,7 +61,7 @@ object SyncTestingExampleSpec { } -class SyncTestingExampleSpec extends WordSpec with Matchers { +class SyncTestingExampleSpec extends AnyWordSpec with Matchers { import SyncTestingExampleSpec._ diff --git a/akka-actor-tests/src/test/java/akka/actor/AbstractFSMActorTest.java b/akka-actor-tests/src/test/java/akka/actor/AbstractFSMActorTest.java index b7b5c51e97..89b0630c63 100644 --- a/akka-actor-tests/src/test/java/akka/actor/AbstractFSMActorTest.java +++ b/akka-actor-tests/src/test/java/akka/actor/AbstractFSMActorTest.java @@ -7,12 +7,9 @@ package akka.actor; import akka.testkit.AkkaJUnitActorSystemResource; import akka.testkit.AkkaSpec; import akka.testkit.TestProbe; -import akka.testkit.javadsl.TestKit; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class AbstractFSMActorTest extends JUnitSuite { diff --git a/akka-actor-tests/src/test/java/akka/actor/ActorCreationTest.java b/akka-actor-tests/src/test/java/akka/actor/ActorCreationTest.java index bcfd4ea618..ee7863f5f4 100644 --- a/akka-actor-tests/src/test/java/akka/actor/ActorCreationTest.java +++ b/akka-actor-tests/src/test/java/akka/actor/ActorCreationTest.java @@ -10,14 +10,10 @@ import static java.util.stream.Collectors.toCollection; import java.util.ArrayList; import java.util.stream.IntStream; -import akka.testkit.TestActors; -import org.junit.Assert; import org.junit.Test; import akka.japi.Creator; -import akka.japi.pf.ReceiveBuilder; - -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class ActorCreationTest extends JUnitSuite { diff --git a/akka-actor-tests/src/test/java/akka/actor/ActorSelectionTest.java b/akka-actor-tests/src/test/java/akka/actor/ActorSelectionTest.java index 0ac496ae77..3aad797d2c 100644 --- a/akka-actor-tests/src/test/java/akka/actor/ActorSelectionTest.java +++ b/akka-actor-tests/src/test/java/akka/actor/ActorSelectionTest.java @@ -8,7 +8,8 @@ import akka.testkit.AkkaJUnitActorSystemResource; import akka.testkit.AkkaSpec; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; + import java.time.Duration; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-tests/src/test/java/akka/actor/ActorSystemTest.java b/akka-actor-tests/src/test/java/akka/actor/ActorSystemTest.java index d53ec123e6..f10f985fc9 100644 --- a/akka-actor-tests/src/test/java/akka/actor/ActorSystemTest.java +++ b/akka-actor-tests/src/test/java/akka/actor/ActorSystemTest.java @@ -8,7 +8,7 @@ import akka.testkit.AkkaJUnitActorSystemResource; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java index 715c4225f7..21cfe14621 100644 --- a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java +++ b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java @@ -20,7 +20,7 @@ import akka.testkit.TestProbe; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.Option; import java.util.Optional; diff --git a/akka-actor-tests/src/test/java/akka/actor/JavaExtension.java b/akka-actor-tests/src/test/java/akka/actor/JavaExtension.java index cbf93c8ad4..76e697491c 100644 --- a/akka-actor-tests/src/test/java/akka/actor/JavaExtension.java +++ b/akka-actor-tests/src/test/java/akka/actor/JavaExtension.java @@ -8,7 +8,7 @@ import akka.testkit.AkkaJUnitActorSystemResource; import org.junit.*; import akka.testkit.AkkaSpec; import com.typesafe.config.ConfigFactory; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static org.junit.Assert.*; diff --git a/akka-actor-tests/src/test/java/akka/actor/StashJavaAPI.java b/akka-actor-tests/src/test/java/akka/actor/StashJavaAPI.java index ae138919cb..3874a74a89 100644 --- a/akka-actor-tests/src/test/java/akka/actor/StashJavaAPI.java +++ b/akka-actor-tests/src/test/java/akka/actor/StashJavaAPI.java @@ -9,7 +9,7 @@ import akka.testkit.TestProbe; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class StashJavaAPI extends JUnitSuite { diff --git a/akka-actor-tests/src/test/java/akka/actor/setup/ActorSystemSetupTest.java b/akka-actor-tests/src/test/java/akka/actor/setup/ActorSystemSetupTest.java index 2fbe8286c1..ae6ef5cf74 100644 --- a/akka-actor-tests/src/test/java/akka/actor/setup/ActorSystemSetupTest.java +++ b/akka-actor-tests/src/test/java/akka/actor/setup/ActorSystemSetupTest.java @@ -4,10 +4,8 @@ package akka.actor.setup; -import akka.actor.setup.ActorSystemSetup; -import akka.actor.setup.Setup; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.Optional; diff --git a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java index 38eb720b90..4a136fcea9 100644 --- a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java +++ b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java @@ -9,8 +9,7 @@ import akka.actor.ActorSystem; import akka.japi.*; import org.junit.ClassRule; -import org.scalatest.junit.JUnitSuite; -import scala.Function1; +import org.scalatestplus.junit.JUnitSuite; import scala.concurrent.Await; import scala.concurrent.Future; import scala.concurrent.Promise; @@ -27,7 +26,6 @@ import java.util.concurrent.TimeUnit; import static akka.japi.Util.classTag; import akka.testkit.AkkaSpec; -import scala.util.Try; public class JavaFutureTests extends JUnitSuite { diff --git a/akka-actor-tests/src/test/java/akka/event/LoggingAdapterTest.java b/akka-actor-tests/src/test/java/akka/event/LoggingAdapterTest.java index 4b3a479ee7..adae579d2d 100644 --- a/akka-actor-tests/src/test/java/akka/event/LoggingAdapterTest.java +++ b/akka-actor-tests/src/test/java/akka/event/LoggingAdapterTest.java @@ -18,7 +18,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.*; import java.time.Duration; diff --git a/akka-actor-tests/src/test/java/akka/japi/JavaAPITestBase.java b/akka-actor-tests/src/test/java/akka/japi/JavaAPITestBase.java index badbcf3d3b..e438545481 100644 --- a/akka-actor-tests/src/test/java/akka/japi/JavaAPITestBase.java +++ b/akka-actor-tests/src/test/java/akka/japi/JavaAPITestBase.java @@ -9,7 +9,7 @@ import akka.event.LoggingAdapter; import akka.event.NoLogging; import akka.serialization.JavaSerializer; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.Callable; diff --git a/akka-actor-tests/src/test/java/akka/japi/MatchBuilderTest.java b/akka-actor-tests/src/test/java/akka/japi/MatchBuilderTest.java index 0c55fc008c..cfc0e7976c 100644 --- a/akka-actor-tests/src/test/java/akka/japi/MatchBuilderTest.java +++ b/akka-actor-tests/src/test/java/akka/japi/MatchBuilderTest.java @@ -9,7 +9,7 @@ import akka.japi.pf.Match; import org.junit.Rule; import org.junit.rules.ExpectedException; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.MatchError; import static org.junit.Assert.*; diff --git a/akka-actor-tests/src/test/java/akka/japi/pf/PFBuilderTest.java b/akka-actor-tests/src/test/java/akka/japi/pf/PFBuilderTest.java index 7995301e3f..e3f76a3307 100644 --- a/akka-actor-tests/src/test/java/akka/japi/pf/PFBuilderTest.java +++ b/akka-actor-tests/src/test/java/akka/japi/pf/PFBuilderTest.java @@ -5,7 +5,7 @@ package akka.japi.pf; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.PartialFunction; import static org.junit.Assert.*; diff --git a/akka-actor-tests/src/test/java/akka/japi/pf/ReceiveBuilderTest.java b/akka-actor-tests/src/test/java/akka/japi/pf/ReceiveBuilderTest.java index 07e4df681a..cbec2e6021 100644 --- a/akka-actor-tests/src/test/java/akka/japi/pf/ReceiveBuilderTest.java +++ b/akka-actor-tests/src/test/java/akka/japi/pf/ReceiveBuilderTest.java @@ -8,9 +8,9 @@ import java.util.Arrays; import java.util.List; import org.junit.Test; import org.junit.Before; -import org.scalatest.junit.JUnitSuite; import akka.actor.AbstractActor.Receive; +import org.scalatestplus.junit.JUnitSuite; import static org.junit.Assert.*; diff --git a/akka-actor-tests/src/test/java/akka/pattern/CircuitBreakerTest.java b/akka-actor-tests/src/test/java/akka/pattern/CircuitBreakerTest.java index 4dc6bdf5b2..38a8a5bf4c 100644 --- a/akka-actor-tests/src/test/java/akka/pattern/CircuitBreakerTest.java +++ b/akka-actor-tests/src/test/java/akka/pattern/CircuitBreakerTest.java @@ -10,7 +10,7 @@ import akka.testkit.AkkaSpec; import akka.util.JavaDurationConverters; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.compat.java8.FutureConverters; import scala.concurrent.Await; diff --git a/akka-actor-tests/src/test/java/akka/pattern/PatternsTest.java b/akka-actor-tests/src/test/java/akka/pattern/PatternsTest.java index a72505a365..db6dbaf286 100644 --- a/akka-actor-tests/src/test/java/akka/pattern/PatternsTest.java +++ b/akka-actor-tests/src/test/java/akka/pattern/PatternsTest.java @@ -12,7 +12,7 @@ import akka.testkit.TestProbe; import akka.util.Timeout; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.concurrent.Await; import scala.concurrent.ExecutionContext; import scala.concurrent.Future; diff --git a/akka-actor-tests/src/test/java/akka/util/ByteStringTest.java b/akka-actor-tests/src/test/java/akka/util/ByteStringTest.java index 15fe9fd9e9..d3acf8f232 100644 --- a/akka-actor-tests/src/test/java/akka/util/ByteStringTest.java +++ b/akka-actor-tests/src/test/java/akka/util/ByteStringTest.java @@ -5,7 +5,7 @@ package akka.util; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static junit.framework.TestCase.assertEquals; diff --git a/akka-actor-tests/src/test/java/akka/util/JavaDuration.java b/akka-actor-tests/src/test/java/akka/util/JavaDuration.java index 587dce72c4..eabf142cda 100644 --- a/akka-actor-tests/src/test/java/akka/util/JavaDuration.java +++ b/akka-actor-tests/src/test/java/akka/util/JavaDuration.java @@ -5,7 +5,7 @@ package akka.util; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.concurrent.duration.Duration; public class JavaDuration extends JUnitSuite { diff --git a/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala b/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala index 0b9f759b8a..05cccafb0e 100644 --- a/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala @@ -5,15 +5,15 @@ package akka import akka.actor._ -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec /** * A spec that verified that the AkkaException has at least a single argument constructor of type String. * * This is required to make Akka Exceptions be friends with serialization/deserialization. */ -class AkkaExceptionSpec extends WordSpec with Matchers { +class AkkaExceptionSpec extends AnyWordSpec with Matchers { "AkkaException" must { "have a AkkaException(String msg) constructor to be serialization friendly" in { diff --git a/akka-actor-tests/src/test/scala/akka/AkkaVersionSpec.scala b/akka-actor-tests/src/test/scala/akka/AkkaVersionSpec.scala index 238fd959a8..5a5ab40efe 100644 --- a/akka-actor-tests/src/test/scala/akka/AkkaVersionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/AkkaVersionSpec.scala @@ -4,9 +4,10 @@ package akka -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class AkkaVersionSpec extends WordSpec with Matchers { +class AkkaVersionSpec extends AnyWordSpec with Matchers { "The Akka version check" must { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala index 3421a5c9b3..6555a6d200 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorPathSpec.scala @@ -6,9 +6,10 @@ package akka.actor import java.net.MalformedURLException -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ActorPathSpec extends WordSpec with Matchers { +class ActorPathSpec extends AnyWordSpec with Matchers { "An ActorPath" must { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala index a85adf854c..ee3686e2fa 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorWithStashSpec.scala @@ -15,7 +15,7 @@ import com.github.ghik.silencer.silent import scala.concurrent.duration._ import org.scalatest.BeforeAndAfterEach -import org.scalatest.junit.JUnitSuiteLike +import org.scalatestplus.junit.JUnitSuiteLike object ActorWithStashSpec { diff --git a/akka-actor-tests/src/test/scala/akka/actor/DynamicAccessSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DynamicAccessSpec.scala index 049f70bffc..d6d093ef9f 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DynamicAccessSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DynamicAccessSpec.scala @@ -4,7 +4,9 @@ package akka.actor -import org.scalatest._ +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec import scala.collection.immutable import scala.concurrent.Await @@ -20,7 +22,7 @@ class TestClassWithDefaultConstructor extends TestSuperclass { override def name = "default" } -class DynamicAccessSpec extends WordSpec with Matchers with BeforeAndAfterAll { +class DynamicAccessSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll { val system = ActorSystem() "The DynamicAccess of a system" should { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ExtensionSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ExtensionSpec.scala index a901ca8e4c..9103cb6b78 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ExtensionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ExtensionSpec.scala @@ -9,12 +9,12 @@ import java.util.concurrent.atomic.AtomicInteger import akka.testkit.EventFilter import akka.testkit.TestKit._ import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } -import org.scalatest.junit.JUnitSuiteLike import scala.util.control.NoStackTrace - import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec +import org.scalatestplus.junit.JUnitSuiteLike @silent class JavaExtensionSpec extends JavaExtension with JUnitSuiteLike @@ -54,7 +54,7 @@ class FailingTestExtension(val system: ExtendedActorSystem) extends Extension { throw new FailingTestExtension.TestException } -class ExtensionSpec extends WordSpec with Matchers { +class ExtensionSpec extends AnyWordSpec with Matchers { "The ActorSystem extensions support" should { diff --git a/akka-actor-tests/src/test/scala/akka/actor/JavaAPISpec.scala b/akka-actor-tests/src/test/scala/akka/actor/JavaAPISpec.scala index 7a5586dd6b..77d6cc90fa 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/JavaAPISpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/JavaAPISpec.scala @@ -4,8 +4,8 @@ package akka.actor -import org.scalatest.junit.JUnitSuiteLike - import com.github.ghik.silencer.silent +import org.scalatestplus.junit.JUnitSuiteLike + @silent class JavaAPISpec extends JavaAPI with JUnitSuiteLike diff --git a/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala index 7db5e3d2f3..e3601e4383 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/RelativeActorPathSpec.scala @@ -4,12 +4,12 @@ package akka.actor -import org.scalatest.WordSpec -import org.scalatest.Matchers import java.net.URLEncoder import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class RelativeActorPathSpec extends WordSpec with Matchers { +class RelativeActorPathSpec extends AnyWordSpec with Matchers { def elements(path: String): immutable.Seq[String] = RelativeActorPath.unapply(path).getOrElse(Nil) diff --git a/akka-actor-tests/src/test/scala/akka/actor/setup/ActorSystemSetupSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/setup/ActorSystemSetupSpec.scala index e0cd4a1a72..2acc8374cf 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/setup/ActorSystemSetupSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/setup/ActorSystemSetupSpec.scala @@ -6,13 +6,14 @@ package akka.actor.setup import akka.actor.ActorSystem import akka.testkit.TestKit -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec case class DummySetup(name: String) extends Setup case class DummySetup2(name: String) extends Setup case class DummySetup3(name: String) extends Setup -class ActorSystemSetupSpec extends WordSpec with Matchers { +class ActorSystemSetupSpec extends AnyWordSpec with Matchers { "The ActorSystemSettings" should { diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/DispatcherShutdownSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/DispatcherShutdownSpec.scala index b70da9a566..7aa060c842 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/DispatcherShutdownSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/DispatcherShutdownSpec.scala @@ -7,11 +7,12 @@ package akka.dispatch import akka.actor.ActorSystem import akka.testkit.TestKit import java.lang.management.ManagementFactory -import org.scalatest.{ Matchers, WordSpec } import scala.concurrent.{ Await, Future } import scala.concurrent.duration._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class DispatcherShutdownSpec extends WordSpec with Matchers { +class DispatcherShutdownSpec extends AnyWordSpec with Matchers { "akka dispatcher" should { diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala index b630b749b9..704c89f77d 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala @@ -13,8 +13,8 @@ import akka.actor._ import java.nio.charset.StandardCharsets import java.util.{ Calendar, Date, GregorianCalendar, TimeZone } -import org.scalatest.WordSpec -import org.scalatest.Matchers +import org.scalatest.wordspec.AnyWordSpec +import org.scalatest.matchers.should.Matchers import akka.serialization.SerializationExtension import akka.event.Logging._ import akka.util.Helpers @@ -139,7 +139,7 @@ object LoggerSpec { } -class LoggerSpec extends WordSpec with Matchers { +class LoggerSpec extends AnyWordSpec with Matchers { import LoggerSpec._ diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala index 617b906b7e..94c6115716 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggingReceiveSpec.scala @@ -9,7 +9,7 @@ import language.postfixOps import org.scalatest.BeforeAndAfterAll import scala.concurrent.duration._ import akka.testkit._ -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec import com.typesafe.config.ConfigFactory import akka.util.ccompat.JavaConverters._ import akka.actor._ @@ -23,7 +23,7 @@ object LoggingReceiveSpec { } } -class LoggingReceiveSpec extends WordSpec with BeforeAndAfterAll { +class LoggingReceiveSpec extends AnyWordSpec with BeforeAndAfterAll { import LoggingReceiveSpec._ val config = ConfigFactory.parseString(""" diff --git a/akka-actor-tests/src/test/scala/akka/io/SimpleDnsCacheSpec.scala b/akka-actor-tests/src/test/scala/akka/io/SimpleDnsCacheSpec.scala index cdddb265bf..6d1dc80584 100644 --- a/akka-actor-tests/src/test/scala/akka/io/SimpleDnsCacheSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/SimpleDnsCacheSpec.scala @@ -11,12 +11,13 @@ import akka.io.dns.ARecord import akka.io.dns.CachePolicy.Ttl import akka.io.dns.DnsProtocol import akka.io.dns.DnsProtocol.Ip -import org.scalatest.{ Matchers, WordSpec } import scala.concurrent.duration._ import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class SimpleDnsCacheSpec extends WordSpec with Matchers { +class SimpleDnsCacheSpec extends AnyWordSpec with Matchers { "Cache" should { "not reply with expired but not yet swept out entries" in { val localClock = new AtomicLong(0) diff --git a/akka-actor-tests/src/test/scala/akka/io/dns/NameserverAddressParserSpec.scala b/akka-actor-tests/src/test/scala/akka/io/dns/NameserverAddressParserSpec.scala index 570ae65d6d..c57dc21b17 100644 --- a/akka-actor-tests/src/test/scala/akka/io/dns/NameserverAddressParserSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/dns/NameserverAddressParserSpec.scala @@ -6,9 +6,10 @@ package akka.io.dns import java.net.InetSocketAddress -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class NameserverAddressParserSpec extends WordSpec with Matchers { +class NameserverAddressParserSpec extends AnyWordSpec with Matchers { "Parser" should { "handle explicit port in IPv4 address" in { DnsSettings.parseNameserverAddress("8.8.8.8:153") shouldEqual new InetSocketAddress("8.8.8.8", 153) diff --git a/akka-actor-tests/src/test/scala/akka/io/dns/internal/MessageSpec.scala b/akka-actor-tests/src/test/scala/akka/io/dns/internal/MessageSpec.scala index d5955a7409..67aeb8cc85 100644 --- a/akka-actor-tests/src/test/scala/akka/io/dns/internal/MessageSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/dns/internal/MessageSpec.scala @@ -6,9 +6,10 @@ package akka.io.dns.internal import akka.io.dns.{ RecordClass, RecordType } import akka.util.ByteString -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MessageSpec extends WordSpec with Matchers { +class MessageSpec extends AnyWordSpec with Matchers { "The Message" should { "parse a response that is truncated mid-message" in { val bytes = ByteString(0, 4, -125, -128, 0, 1, 0, 48, 0, 0, 0, 0, 4, 109, 97, 110, 121, 4, 98, 122, 122, 116, 3, diff --git a/akka-actor-tests/src/test/scala/akka/io/dns/internal/ResolvConfParserSpec.scala b/akka-actor-tests/src/test/scala/akka/io/dns/internal/ResolvConfParserSpec.scala index e513f00d03..7bfcfc0004 100644 --- a/akka-actor-tests/src/test/scala/akka/io/dns/internal/ResolvConfParserSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/dns/internal/ResolvConfParserSpec.scala @@ -4,9 +4,10 @@ package akka.io.dns.internal -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ResolvConfParserSpec extends WordSpec with Matchers { +class ResolvConfParserSpec extends AnyWordSpec with Matchers { private def parse(str: String): ResolvConf = { ResolvConfParser.parseLines(str.linesIterator) diff --git a/akka-actor-tests/src/test/scala/akka/japi/JavaAPITest.scala b/akka-actor-tests/src/test/scala/akka/japi/JavaAPITest.scala index d66d929240..253ee56a9b 100644 --- a/akka-actor-tests/src/test/scala/akka/japi/JavaAPITest.scala +++ b/akka-actor-tests/src/test/scala/akka/japi/JavaAPITest.scala @@ -4,8 +4,8 @@ package akka.japi -import org.scalatest.junit.JUnitSuiteLike import com.github.ghik.silencer.silent +import org.scalatestplus.junit.JUnitSuiteLike @silent class JavaAPITest extends JavaAPITestBase with JUnitSuiteLike diff --git a/akka-actor-tests/src/test/scala/akka/util/AsciiStringCopySpec.scala b/akka-actor-tests/src/test/scala/akka/util/AsciiStringCopySpec.scala index 116ab3cabe..46648e81b7 100644 --- a/akka-actor-tests/src/test/scala/akka/util/AsciiStringCopySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/AsciiStringCopySpec.scala @@ -5,10 +5,10 @@ package akka.util import java.nio.charset.StandardCharsets -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class AsciiStringCopySpec extends WordSpec with Matchers { +class AsciiStringCopySpec extends AnyWordSpec with Matchers { "The copyUSAsciiStrToBytes optimization" must { diff --git a/akka-actor-tests/src/test/scala/akka/util/BoundedBlockingQueueSpec.scala b/akka-actor-tests/src/test/scala/akka/util/BoundedBlockingQueueSpec.scala index f81004be70..8fe3d12563 100644 --- a/akka-actor-tests/src/test/scala/akka/util/BoundedBlockingQueueSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/BoundedBlockingQueueSpec.scala @@ -15,7 +15,8 @@ import org.scalatest.exceptions.TestFailedDueToTimeoutException import org.scalatest.matchers.{ MatchResult, Matcher } import org.scalatest.time.Span import org.scalatest.time.SpanSugar._ -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec import akka.util.ccompat.JavaConverters._ import scala.collection.mutable @@ -23,7 +24,7 @@ import scala.concurrent.{ Await, ExecutionContext, ExecutionContextExecutor, Fut import scala.util.control.Exception class BoundedBlockingQueueSpec - extends WordSpec + extends AnyWordSpec with Matchers with QueueSetupHelper with CustomContainsMatcher diff --git a/akka-actor-tests/src/test/scala/akka/util/ByteIteratorSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ByteIteratorSpec.scala index b6acf72074..3a676e6655 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ByteIteratorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ByteIteratorSpec.scala @@ -5,9 +5,10 @@ package akka.util import akka.util.ByteIterator.ByteArrayIterator -import org.scalatest._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ByteIteratorSpec extends WordSpec with Matchers { +class ByteIteratorSpec extends AnyWordSpec with Matchers { "A ByteIterator" should { "correctly implement indexOf" in { diff --git a/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala index 64a1817897..48fe9fe4ea 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ByteStringSpec.scala @@ -15,12 +15,13 @@ import com.github.ghik.silencer.silent import org.apache.commons.codec.binary.Hex.encodeHex import org.scalacheck.Arbitrary.arbitrary import org.scalacheck.{ Arbitrary, Gen } -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec import org.scalatestplus.scalacheck.Checkers import scala.collection.mutable.Builder -class ByteStringSpec extends WordSpec with Matchers with Checkers { +class ByteStringSpec extends AnyWordSpec with Matchers with Checkers { implicit val betterGeneratorDrivenConfig = PropertyCheckConfiguration().copy(minSuccessful = 1000) diff --git a/akka-actor-tests/src/test/scala/akka/util/ImmutableIntMapSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ImmutableIntMapSpec.scala index 5e8c374624..a1004ae22c 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ImmutableIntMapSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ImmutableIntMapSpec.scala @@ -3,12 +3,12 @@ */ package akka.util -import org.scalatest.Matchers -import org.scalatest.WordSpec import scala.util.Random +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ImmutableIntMapSpec extends WordSpec with Matchers { +class ImmutableIntMapSpec extends AnyWordSpec with Matchers { "ImmutableIntMap" must { diff --git a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala index 63510ad741..35e626f35e 100644 --- a/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/IndexSpec.scala @@ -5,12 +5,12 @@ package akka.util import java.util.Comparator -import org.scalatest.Matchers import scala.concurrent.Future import akka.testkit.AkkaSpec import scala.concurrent.Await import scala.util.Random import akka.testkit.DefaultTimeout +import org.scalatest.matchers.should.Matchers class IndexSpec extends AkkaSpec with Matchers with DefaultTimeout { implicit val ec = system.dispatcher diff --git a/akka-actor-tests/src/test/scala/akka/util/JavaDurationSpec.scala b/akka-actor-tests/src/test/scala/akka/util/JavaDurationSpec.scala index 938ea23933..9875dc48f0 100644 --- a/akka-actor-tests/src/test/scala/akka/util/JavaDurationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/JavaDurationSpec.scala @@ -4,8 +4,8 @@ package akka.util -import org.scalatest.junit.JUnitSuiteLike import com.github.ghik.silencer.silent +import org.scalatestplus.junit.JUnitSuiteLike @silent class JavaDurationSpec extends JavaDuration with JUnitSuiteLike diff --git a/akka-actor-tests/src/test/scala/akka/util/ManifestInfoVersionSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ManifestInfoVersionSpec.scala index 22ed782e77..7cdfd24cd4 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ManifestInfoVersionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ManifestInfoVersionSpec.scala @@ -4,11 +4,11 @@ package akka.util -import org.scalatest.Matchers -import org.scalatest.WordSpec import akka.util.ManifestInfo.Version +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ManifestInfoVersionSpec extends WordSpec with Matchers { +class ManifestInfoVersionSpec extends AnyWordSpec with Matchers { "Version" should { diff --git a/akka-actor-tests/src/test/scala/akka/util/MessageBufferSpec.scala b/akka-actor-tests/src/test/scala/akka/util/MessageBufferSpec.scala index e42f3a49b8..fd7f173280 100644 --- a/akka-actor-tests/src/test/scala/akka/util/MessageBufferSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/MessageBufferSpec.scala @@ -5,10 +5,10 @@ package akka.util import akka.actor.{ ActorPath, ActorRef, ActorRefProvider, MinimalActorRef } -import org.scalatest.WordSpec -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MessageBufferSpec extends WordSpec with Matchers { +class MessageBufferSpec extends AnyWordSpec with Matchers { import MessageBufferSpec._ diff --git a/akka-actor-tests/src/test/scala/akka/util/PrettyDurationSpec.scala b/akka-actor-tests/src/test/scala/akka/util/PrettyDurationSpec.scala index 668720b9b1..70a6ff56d0 100644 --- a/akka-actor-tests/src/test/scala/akka/util/PrettyDurationSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/PrettyDurationSpec.scala @@ -4,9 +4,10 @@ package akka.util -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PrettyDurationSpec extends WordSpec with Matchers { +class PrettyDurationSpec extends AnyWordSpec with Matchers { import akka.util.PrettyDuration._ diff --git a/akka-actor-tests/src/test/scala/akka/util/ReflectSpec.scala b/akka-actor-tests/src/test/scala/akka/util/ReflectSpec.scala index 9b939c8dc6..9fc8003040 100644 --- a/akka-actor-tests/src/test/scala/akka/util/ReflectSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/ReflectSpec.scala @@ -4,9 +4,9 @@ package akka.util -import org.scalatest.{ Matchers, WordSpec } - import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object ReflectSpec { final class A @@ -21,7 +21,7 @@ object ReflectSpec { } } -class ReflectSpec extends WordSpec with Matchers { +class ReflectSpec extends AnyWordSpec with Matchers { import akka.util.ReflectSpec._ diff --git a/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala b/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala index 408b3124e8..04cefc7e55 100644 --- a/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/SwitchSpec.scala @@ -4,12 +4,12 @@ package akka.util -import org.scalatest.WordSpec -import org.scalatest.Matchers import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class SwitchSpec extends WordSpec with Matchers { +class SwitchSpec extends AnyWordSpec with Matchers { "Switch" must { diff --git a/akka-actor-tests/src/test/scala/akka/util/TypedMultiMapSpec.scala b/akka-actor-tests/src/test/scala/akka/util/TypedMultiMapSpec.scala index 2e2ff4d45c..99388f1494 100644 --- a/akka-actor-tests/src/test/scala/akka/util/TypedMultiMapSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/TypedMultiMapSpec.scala @@ -4,9 +4,9 @@ package akka.util -import org.scalatest.WordSpec -import org.scalatest.Matchers import org.scalactic.TypeCheckedTripleEquals +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object TypedMultiMapSpec { trait AbstractKey { type Type } @@ -16,7 +16,7 @@ object TypedMultiMapSpec { type KV[K <: AbstractKey] = MyValue[K#Type] } -class TypedMultiMapSpec extends WordSpec with Matchers with TypeCheckedTripleEquals { +class TypedMultiMapSpec extends AnyWordSpec with Matchers with TypeCheckedTripleEquals { import TypedMultiMapSpec._ "A TypedMultiMap" must { diff --git a/akka-actor-tests/src/test/scala/akka/util/WildcardIndexSpec.scala b/akka-actor-tests/src/test/scala/akka/util/WildcardIndexSpec.scala index 833b751f33..d1091cc021 100644 --- a/akka-actor-tests/src/test/scala/akka/util/WildcardIndexSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/util/WildcardIndexSpec.scala @@ -4,9 +4,10 @@ package akka.util -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class WildcardIndexSpec extends WordSpec with Matchers { +class WildcardIndexSpec extends AnyWordSpec with Matchers { "wildcard index" must { "allow to insert elements using Arrays of strings" in { diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/ActorSystemTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/ActorSystemTest.java index f4b67d1d0b..30489818f7 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/ActorSystemTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/ActorSystemTest.java @@ -7,7 +7,7 @@ package akka.actor.typed; import akka.Done; import akka.actor.typed.javadsl.Behaviors; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/ExtensionsTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/ExtensionsTest.java index 63ccd8450f..262e08509a 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/ExtensionsTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/ExtensionsTest.java @@ -9,7 +9,7 @@ import akka.actor.typed.javadsl.Behaviors; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.function.Function; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextAskTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextAskTest.java index 9b82b89dbc..cc36eb2501 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextAskTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextAskTest.java @@ -10,11 +10,10 @@ import akka.actor.typed.Behavior; import akka.testkit.AkkaSpec; import akka.actor.testkit.typed.javadsl.TestKitJunitResource; import akka.actor.testkit.typed.javadsl.TestProbe; -import akka.util.Timeout; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; import java.util.concurrent.TimeUnit; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextPipeToSelfTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextPipeToSelfTest.java index 21ee7b0ed7..c45b78a2c5 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextPipeToSelfTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorContextPipeToSelfTest.java @@ -13,7 +13,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorLoggingTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorLoggingTest.java index 1acd73f09a..b255549132 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorLoggingTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ActorLoggingTest.java @@ -15,7 +15,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.concurrent.duration.FiniteDuration; import java.util.HashMap; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java index 016f92c44d..c0c7114a65 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/AdapterTest.java @@ -9,7 +9,7 @@ import akka.actor.typed.internal.adapter.SchedulerAdapter; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/BehaviorBuilderTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/BehaviorBuilderTest.java index 926179c066..5a11d7d43d 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/BehaviorBuilderTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/BehaviorBuilderTest.java @@ -10,7 +10,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import akka.actor.typed.Behavior; import akka.actor.typed.Terminated; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/InterceptTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/InterceptTest.java index fcc73a7dfb..d7083db51b 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/InterceptTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/InterceptTest.java @@ -12,7 +12,7 @@ import akka.testkit.AkkaSpec; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class InterceptTest extends JUnitSuite { diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ReceiveBuilderTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ReceiveBuilderTest.java index 7ebd019908..3f6cfe7cd3 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ReceiveBuilderTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/ReceiveBuilderTest.java @@ -12,7 +12,7 @@ import akka.actor.typed.PostStop; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import akka.actor.typed.Behavior; diff --git a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/WatchTest.java b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/WatchTest.java index 8812eda5a8..8598fb4a19 100644 --- a/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/WatchTest.java +++ b/akka-actor-typed-tests/src/test/java/akka/actor/typed/javadsl/WatchTest.java @@ -12,7 +12,7 @@ import akka.actor.testkit.typed.javadsl.LogCapturing; import akka.actor.testkit.typed.javadsl.TestKitJunitResource; import org.junit.ClassRule; import org.junit.Rule; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import org.junit.Test; import akka.actor.typed.*; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/AggregatorTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/AggregatorTest.java index ce7f32fba3..13f3d1b196 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/AggregatorTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/AggregatorTest.java @@ -16,7 +16,7 @@ import akka.actor.typed.javadsl.Receive; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.math.BigDecimal; import java.time.Duration; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java index c1bc82bb65..6eb56751aa 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/BubblingSampleTest.java @@ -11,7 +11,7 @@ import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/DispatchersDocTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/DispatchersDocTest.java index e6d788fb62..0f6cd3cbef 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/DispatchersDocTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/DispatchersDocTest.java @@ -6,7 +6,6 @@ package jdocs.akka.typed; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.*; -import org.scalatest.junit.JUnitSuite; import akka.actor.typed.DispatcherSelector; public class DispatchersDocTest { diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/InteractionPatternsTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/InteractionPatternsTest.java index fd675e2205..5da952c088 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/InteractionPatternsTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/InteractionPatternsTest.java @@ -15,7 +15,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.net.URI; import java.time.Duration; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/MailboxDocTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/MailboxDocTest.java index 6097ae1535..efa5e89e93 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/MailboxDocTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/MailboxDocTest.java @@ -16,7 +16,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class MailboxDocTest extends JUnitSuite { diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/StashDocTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/StashDocTest.java index d86798a251..d5777f1c24 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/StashDocTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/StashDocTest.java @@ -12,7 +12,7 @@ import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java index 16c323be0d..0e3a0024ff 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/ClassicWatchingTypedTest.java @@ -16,7 +16,7 @@ import akka.actor.typed.javadsl.Adapter; import akka.testkit.TestProbe; import akka.testkit.javadsl.TestKit; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import scala.concurrent.duration.Duration; import static akka.actor.typed.javadsl.Behaviors.same; diff --git a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java index e3cf312fd2..ee4069bf80 100644 --- a/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java +++ b/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/coexistence/TypedWatchingClassicTest.java @@ -18,7 +18,7 @@ import akka.actor.typed.javadsl.Behaviors; import akka.actor.typed.javadsl.Receive; import akka.testkit.javadsl.TestKit; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class TypedWatchingClassicTest extends JUnitSuite { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala index da5ceeaa9b..c9ffc1785d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorContextSpec.scala @@ -16,7 +16,7 @@ import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.eventstream.EventStream -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ActorSpecMessages { @@ -66,7 +66,7 @@ object ActorSpecMessages { } -abstract class ActorContextSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +abstract class ActorContextSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import ActorSpecMessages._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorRefResolverSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorRefResolverSpec.scala index cb7cce7098..586392d7ba 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorRefResolverSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ActorRefResolverSpec.scala @@ -10,11 +10,11 @@ import akka.actor.ActorSystemImpl import akka.actor.MinimalActorRef import akka.actor.RootActorPath import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.Matchers -import org.scalatest.WordSpec import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ActorRefResolverSpec extends WordSpec with ScalaFutures with Matchers { +class ActorRefResolverSpec extends AnyWordSpec with ScalaFutures with Matchers { "ActorRefResolver" should { "not allow serialization of ref originating from other system" in { val system1 = ActorSystem(Behaviors.empty[String], "sys1") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala index f24eef5c84..a7c9a7884d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/AskSpec.scala @@ -15,7 +15,6 @@ import scala.concurrent.{ ExecutionContext, TimeoutException } import scala.util.Success import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import org.scalatest.WordSpecLike import scala.concurrent.Future import akka.actor.DeadLetter @@ -23,6 +22,7 @@ import akka.actor.UnhandledMessage import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.eventstream.EventStream +import org.scalatest.wordspec.AnyWordSpecLike object AskSpec { sealed trait Msg @@ -30,7 +30,7 @@ object AskSpec { final case class Stop(replyTo: ActorRef[Unit]) extends Msg } -class AskSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class AskSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import AskSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/BehaviorSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/BehaviorSpec.scala index 838112cd23..9879948a66 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/BehaviorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/BehaviorSpec.scala @@ -15,9 +15,9 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.{ BehaviorTestKit, TestInbox } import org.scalactic.TypeCheckedTripleEquals -import org.scalatest.Matchers -import org.scalatest.WordSpecLike import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object BehaviorSpec { sealed trait Command { @@ -69,7 +69,7 @@ object BehaviorSpec { override def next = StateA } - trait Common extends WordSpecLike with Matchers with TypeCheckedTripleEquals with LogCapturing { + trait Common extends AnyWordSpecLike with Matchers with TypeCheckedTripleEquals with LogCapturing { type Aux >: Null <: AnyRef def behavior(monitor: ActorRef[Event]): (Behavior[Command], Aux) @silent("never used") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala index 8baaf9aaf3..db0bf89418 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/DeferredSpec.scala @@ -11,7 +11,8 @@ import scala.util.control.NoStackTrace import akka.actor.ActorInitializationException import akka.actor.testkit.typed.scaladsl.LoggingTestKit -import org.scalatest.{ Matchers, WordSpec, WordSpecLike } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } object DeferredSpec { sealed trait Command @@ -30,7 +31,7 @@ object DeferredSpec { }) } -class DeferredSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class DeferredSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import DeferredSpec._ implicit val testSettings = TestKitSettings(system) @@ -146,7 +147,7 @@ class DeferredSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogC } } -class DeferredStubbedSpec extends WordSpec with Matchers with LogCapturing { +class DeferredStubbedSpec extends AnyWordSpec with Matchers with LogCapturing { import DeferredSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala index 9b0db9fa46..cadbb790ab 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/ExtensionsSpec.scala @@ -16,7 +16,7 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.receptionist.Receptionist import akka.actor.typed.receptionist.ServiceKey import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class DummyExtension1 extends Extension object DummyExtension1 extends ExtensionId[DummyExtension1] { @@ -73,7 +73,7 @@ akka.actor.typed { """).resolve() } -class ExtensionsSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class ExtensionsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "The extensions subsystem" must { "return the same instance for the same id" in diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala index a750cafcab..ba6ce40d5e 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/InterceptSpec.scala @@ -8,7 +8,6 @@ import java.util.concurrent.atomic.AtomicBoolean import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike import scala.concurrent.duration._ import akka.actor.ActorInitializationException @@ -17,6 +16,7 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.internal.PoisonPill import akka.actor.typed.internal.PoisonPillInterceptor +import org.scalatest.wordspec.AnyWordSpecLike object InterceptSpec { final case class Msg(hello: String, replyTo: ActorRef[String]) @@ -75,7 +75,7 @@ object InterceptSpec { } } -class InterceptSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class InterceptSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import BehaviorInterceptor._ import InterceptSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala index 036c3577cb..c896571230 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/LogMessagesSpec.scala @@ -10,12 +10,12 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.adapter._ -import org.scalatest.WordSpecLike import org.slf4j.event.Level +import org.scalatest.wordspec.AnyWordSpecLike class LogMessagesSpec extends ScalaTestWithActorTestKit(""" akka.loglevel = DEBUG # test verifies debug - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { implicit val classic: actor.ActorSystem = system.toClassic diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala index 7feb8bc75c..7e1f8e2edc 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MailboxSelectorSpec.scala @@ -18,14 +18,14 @@ import akka.dispatch.BoundedMessageQueueSemantics import akka.dispatch.BoundedNodeMessageQueue import akka.dispatch.MessageQueue import akka.dispatch.UnboundedMessageQueueSemantics -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class MailboxSelectorSpec extends ScalaTestWithActorTestKit(""" specific-mailbox { mailbox-type = "akka.dispatch.NonBlockingBoundedMailbox" mailbox-capacity = 4 } - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { case class WhatsYourMailbox(replyTo: ActorRef[MessageQueue]) private def behavior: Behavior[WhatsYourMailbox] = diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MonitorSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MonitorSpec.scala index 65744311d6..5ed04d106c 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MonitorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/MonitorSpec.scala @@ -8,9 +8,9 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class MonitorSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class MonitorSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "The monitor behavior" should { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/OrElseSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/OrElseSpec.scala index 9d79bb50e7..b247dd534b 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/OrElseSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/OrElseSpec.scala @@ -8,8 +8,8 @@ import scala.annotation.tailrec import akka.actor.testkit.typed.scaladsl._ import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec /** * Background: Originally there was an `OrElseBehavior` that could compose two `Behavior`, but that @@ -183,7 +183,7 @@ object OrElseSpec { } -class OrElseSpec extends WordSpec with Matchers with LogCapturing { +class OrElseSpec extends AnyWordSpec with Matchers with LogCapturing { import OrElseSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/PropsSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/PropsSpec.scala index 10c6fe5118..ddf3081658 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/PropsSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/PropsSpec.scala @@ -5,10 +5,10 @@ package akka.actor.typed import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PropsSpec extends WordSpec with Matchers with LogCapturing { +class PropsSpec extends AnyWordSpec with Matchers with LogCapturing { val dispatcherFirst = Props.empty.withDispatcherFromConfig("pool").withDispatcherDefault diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SpawnProtocolSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SpawnProtocolSpec.scala index bde6964b51..fec98eaa65 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SpawnProtocolSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SpawnProtocolSpec.scala @@ -9,9 +9,10 @@ import akka.actor.testkit.typed.TestKitSettings import akka.actor.testkit.typed.scaladsl._ import akka.actor.typed.scaladsl.Behaviors import akka.util.Timeout -import org.scalatest.{ Matchers, WordSpec, WordSpecLike } import scala.concurrent.Future +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } object SpawnProtocolSpec { sealed trait Message @@ -26,7 +27,7 @@ object SpawnProtocolSpec { } } -class SpawnProtocolSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class SpawnProtocolSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import SpawnProtocolSpec._ implicit val testSettings = TestKitSettings(system) @@ -96,7 +97,7 @@ class SpawnProtocolSpec extends ScalaTestWithActorTestKit with WordSpecLike with } } -class StubbedSpawnProtocolSpec extends WordSpec with Matchers with LogCapturing { +class StubbedSpawnProtocolSpec extends AnyWordSpec with Matchers with LogCapturing { import SpawnProtocolSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala index a66f17b594..833dfee28c 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/SupervisionSpec.scala @@ -24,10 +24,9 @@ import akka.actor.typed.scaladsl.Behaviors._ import akka.actor.typed.scaladsl.AbstractBehavior import akka.actor.typed.scaladsl.ActorContext import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.Matchers -import org.scalatest.WordSpec -import org.scalatest.WordSpecLike import org.slf4j.event.Level +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } object SupervisionSpec { @@ -94,7 +93,7 @@ object SupervisionSpec { } } -class StubbedSupervisionSpec extends WordSpec with Matchers with LogCapturing { +class StubbedSupervisionSpec extends AnyWordSpec with Matchers with LogCapturing { import SupervisionSpec._ @@ -255,7 +254,7 @@ class StubbedSupervisionSpec extends WordSpec with Matchers with LogCapturing { class SupervisionSpec extends ScalaTestWithActorTestKit(""" akka.log-dead-letters = off - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { import BehaviorInterceptor._ import SupervisionSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TerminatedSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TerminatedSpec.scala index 7f852f8a3f..e7739609c3 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TerminatedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TerminatedSpec.scala @@ -6,9 +6,10 @@ package akka.actor.typed import akka.actor.testkit.typed.scaladsl.TestInbox import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class TerminatedSpec extends WordSpec with Matchers with LogCapturing { +class TerminatedSpec extends AnyWordSpec with Matchers with LogCapturing { "Child Failed" must { "should be pattern matchable" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala index f336918814..0713634825 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TimerSpec.scala @@ -19,9 +19,9 @@ import akka.actor.typed.eventstream.EventStream import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.TimerScheduler import akka.testkit.TimingTest -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class TimerSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class TimerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { sealed trait Command case class Tick(n: Int) extends Command diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala index a37ea3e864..beba7444d7 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/TransformMessagesSpec.scala @@ -11,11 +11,11 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.adapter._ -import org.scalatest.WordSpecLike import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing +import org.scalatest.wordspec.AnyWordSpecLike object TransformMessagesSpec { @@ -33,7 +33,7 @@ object TransformMessagesSpec { } } -class TransformMessagesSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class TransformMessagesSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { implicit val classicSystem = system.toClassic diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala index 34b29cce30..da398bb037 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/WatchSpec.scala @@ -16,7 +16,7 @@ import akka.actor.testkit.typed.TestException import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object WatchSpec { @@ -43,7 +43,7 @@ object WatchSpec { case class StartWatchingWith(watchee: ActorRef[Stop.type], message: CustomTerminationMessage) extends Message } -class WatchSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class WatchSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { implicit def classicSystem = system.toClassic diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala index ee4a340fd4..a7aed5982a 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/ClassicSupervisingTypedSpec.scala @@ -12,7 +12,8 @@ import akka.actor.typed.scaladsl.adapter._ import akka.testkit.TestProbe import akka.{ actor => u } import com.typesafe.config.ConfigFactory -import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.wordspec.AnyWordSpecLike object ProbedBehavior { def behavior(probe: u.ActorRef): Behavior[String] = { @@ -45,7 +46,7 @@ object ClassicSupervisingTypedSpec { } } -class ClassicSupervisingTypedSpec extends WordSpecLike with LogCapturing with BeforeAndAfterAll { +class ClassicSupervisingTypedSpec extends AnyWordSpecLike with LogCapturing with BeforeAndAfterAll { import ClassicSupervisingTypedSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala index 20c41f22f6..335308b78c 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/coexistence/TypedSupervisingClassicSpec.scala @@ -9,9 +9,9 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import akka.actor.typed.ActorRef import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike import akka.actor.typed.scaladsl.adapter._ import akka.{ actor => classic } +import org.scalatest.wordspec.AnyWordSpecLike object TypedSupervisingClassicSpec { @@ -43,7 +43,7 @@ object TypedSupervisingClassicSpec { class TypedSupervisingClassicSpec extends ScalaTestWithActorTestKit(""" akka.loglevel = INFO - """.stripMargin) with WordSpecLike with LogCapturing { + """.stripMargin) with AnyWordSpecLike with LogCapturing { import TypedSupervisingClassicSpec._ "Typed supervising classic" should { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala index c7d0155715..826c52cc4d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/eventstream/EventStreamSpec.scala @@ -8,9 +8,9 @@ import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class EventStreamSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class EventStreamSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import EventStreamSpec._ import EventStream._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala index bebe4feb26..01dc803ee9 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorRefSerializationSpec.scala @@ -10,7 +10,7 @@ import akka.serialization.{ JavaSerializer, SerializationExtension } import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ActorRefSerializationSpec { def config = ConfigFactory.parseString(""" @@ -28,7 +28,7 @@ object ActorRefSerializationSpec { class ActorRefSerializationSpec extends ScalaTestWithActorTestKit(ActorRefSerializationSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { val serialization = SerializationExtension(system) diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala index a0ab39e43c..ee7e359757 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/ActorSystemSpec.scala @@ -14,12 +14,14 @@ import akka.actor.{ Address, CoordinatedShutdown, InvalidMessageException } import akka.actor.testkit.typed.scaladsl.TestInbox import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.scaladsl.Behaviors -import org.scalatest._ +import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec class ActorSystemSpec - extends WordSpec + extends AnyWordSpec with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/adpater/PropsAdapterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/adpater/PropsAdapterSpec.scala index b8ca179008..d9786277a6 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/adpater/PropsAdapterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/adpater/PropsAdapterSpec.scala @@ -8,10 +8,10 @@ import akka.actor import akka.actor.typed.Props import akka.actor.typed.internal.adapter.PropsAdapter import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PropsAdapterSpec extends WordSpec with Matchers { +class PropsAdapterSpec extends AnyWordSpec with Matchers { "PropsAdapter" should { "default to akka.dispatch.SingleConsumerOnlyUnboundedMailbox" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/LocalReceptionistSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/LocalReceptionistSpec.scala index 697d74131f..b041bd4fc2 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/LocalReceptionistSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/LocalReceptionistSpec.scala @@ -17,7 +17,8 @@ import akka.actor.typed.receptionist.Receptionist._ import akka.actor.typed.receptionist.ServiceKey import akka.actor.typed.scaladsl.AskPattern._ import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.{ Matchers, WordSpec, WordSpecLike } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.{ AnyWordSpec, AnyWordSpecLike } object LocalReceptionistSpec { trait ServiceA @@ -38,7 +39,7 @@ object LocalReceptionistSpec { } -class LocalReceptionistSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class LocalReceptionistSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import LocalReceptionistSpec._ "A local receptionist" must { @@ -193,7 +194,7 @@ class LocalReceptionistSpec extends ScalaTestWithActorTestKit with WordSpecLike } } -class LocalReceptionistBehaviorSpec extends WordSpec with Matchers with LogCapturing { +class LocalReceptionistBehaviorSpec extends AnyWordSpec with Matchers with LogCapturing { import LocalReceptionistSpec._ def assertEmpty(inboxes: TestInbox[_]*): Unit = { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala index b2e6f4de04..b395d65c14 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/ServiceKeySerializationSpec.scala @@ -9,11 +9,11 @@ import akka.actor.typed.receptionist.ServiceKey import akka.serialization.SerializationExtension import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class ServiceKeySerializationSpec extends ScalaTestWithActorTestKit(ActorRefSerializationSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { val serialization = SerializationExtension(system) diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/PoolRouterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/PoolRouterSpec.scala index d5723740da..827c32b54e 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/PoolRouterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/PoolRouterSpec.scala @@ -7,7 +7,7 @@ package akka.actor.typed.internal.routing import akka.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestKit } import akka.actor.typed.{ ActorRef, Behavior, DispatcherSelector } import akka.actor.typed.scaladsl.{ Behaviors, Routers } -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object PoolRouterSpec { @@ -23,7 +23,7 @@ object PoolRouterSpec { } } -class PoolRouterSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class PoolRouterSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import PoolRouterSpec.RouteeBehavior import RouteeBehavior.WhichDispatcher diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/RoutingLogicSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/RoutingLogicSpec.scala index 2f55a9e8c6..411f162e84 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/RoutingLogicSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/routing/RoutingLogicSpec.scala @@ -9,9 +9,10 @@ import akka.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestK import akka.actor.typed.internal.routing.RoutingLogics.ConsistentHashingLogic import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.{ ActorSystem, Behavior } -import org.scalatest.{ Matchers, WordSpecLike } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class RoutingLogicSpec extends ScalaTestWithActorTestKit with WordSpecLike with Matchers with LogCapturing { +class RoutingLogicSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with Matchers with LogCapturing { val emptyMessage: Any = "" diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala index af7e7112e8..04d4365440 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala @@ -15,7 +15,7 @@ import scala.util.{ Failure, Success } import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ActorContextAskSpec { val config = ConfigFactory.parseString(""" @@ -32,7 +32,7 @@ object ActorContextAskSpec { class ActorContextAskSpec extends ScalaTestWithActorTestKit(ActorContextAskSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "The Scala DSL ActorContext" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala index ef8324dab4..ae3b4656bb 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextPipeToSelfSpec.scala @@ -12,7 +12,7 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, TestProbe } import akka.actor.typed.Props import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ActorContextPipeToSelfSpec { val config = ConfigFactory.parseString(""" @@ -25,7 +25,7 @@ object ActorContextPipeToSelfSpec { final class ActorContextPipeToSelfSpec extends ScalaTestWithActorTestKit(ActorContextPipeToSelfSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "The Scala DSL ActorContext pipeToSelf" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala index 9be70b8b64..be88570067 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorLoggingSpec.scala @@ -24,10 +24,10 @@ import akka.event.Logging.DefaultLogger import akka.event.slf4j.Slf4jLogger import akka.event.slf4j.Slf4jLoggingFilter import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike import org.slf4j.LoggerFactory import org.slf4j.MDC import org.slf4j.helpers.BasicMarkerFactory +import org.scalatest.wordspec.AnyWordSpecLike class SomeClass @@ -52,7 +52,7 @@ class BehaviorWhereTheLoggerIsUsed(context: ActorContext[String]) extends Abstra class ActorLoggingSpec extends ScalaTestWithActorTestKit(""" akka.loglevel = DEBUG # test verifies debug - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { val marker = new BasicMarkerFactory().getMarker("marker") val cause = TestException("böö") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/DispatcherSelectorSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/DispatcherSelectorSpec.scala index 84f725d608..20407251fa 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/DispatcherSelectorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/DispatcherSelectorSpec.scala @@ -16,7 +16,7 @@ import akka.actor.typed.Behavior import akka.actor.typed.Props import akka.actor.typed.SpawnProtocol import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object DispatcherSelectorSpec { val config = ConfigFactory.parseString(""" @@ -42,7 +42,7 @@ object DispatcherSelectorSpec { class DispatcherSelectorSpec extends ScalaTestWithActorTestKit(DispatcherSelectorSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import DispatcherSelectorSpec.PingPong import DispatcherSelectorSpec.PingPong._ diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/GracefulStopSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/GracefulStopSpec.scala index 0d4671380f..60a88e8763 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/GracefulStopSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/GracefulStopSpec.scala @@ -10,9 +10,9 @@ import akka.NotUsed import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -final class GracefulStopSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +final class GracefulStopSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Graceful stop" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/LoggerOpsSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/LoggerOpsSpec.scala index 975d920361..21a46adb97 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/LoggerOpsSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/LoggerOpsSpec.scala @@ -7,8 +7,8 @@ package akka.actor.typed.scaladsl import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike import org.slf4j.LoggerFactory +import org.scalatest.wordspec.AnyWordSpecLike object LoggerOpsSpec { case class Value1(i: Int) @@ -16,7 +16,7 @@ object LoggerOpsSpec { case class Value3(i: Int) } -class LoggerOpsSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class LoggerOpsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import LoggerOpsSpec._ val log = LoggerFactory.getLogger(getClass) diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala index e54652f2f1..2abd1e3a94 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/MessageAdapterSpec.scala @@ -16,8 +16,8 @@ import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.eventstream.EventStream import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike import org.slf4j.event.Level +import org.scalatest.wordspec.AnyWordSpecLike object MessageAdapterSpec { val config = ConfigFactory.parseString(""" @@ -35,7 +35,7 @@ object MessageAdapterSpec { class MessageAdapterSpec extends ScalaTestWithActorTestKit(MessageAdapterSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "Message adapters" must { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/OnSignalSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/OnSignalSpec.scala index 8460c18556..f1a32c50d1 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/OnSignalSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/OnSignalSpec.scala @@ -9,9 +9,9 @@ import akka.Done import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -final class OnSignalSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +final class OnSignalSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "An Actor.OnSignal behavior" must { "must correctly install the signal handler" in { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ReceivePartialSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ReceivePartialSpec.scala index d4eecf4696..cb4fe4b9ec 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ReceivePartialSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ReceivePartialSpec.scala @@ -8,9 +8,9 @@ package scaladsl import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class ReceivePartialSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class ReceivePartialSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { implicit val ec = system.executionContext diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala index 5ac67e3b60..ca8c657f74 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/RoutersSpec.scala @@ -12,11 +12,12 @@ import akka.actor.typed.receptionist.{ Receptionist, ServiceKey } import akka.actor.typed.scaladsl.adapter._ import akka.actor.typed.{ ActorRef, Behavior } import akka.actor.{ ActorSystem, Dropped } -import org.scalatest.{ Matchers, WordSpecLike } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class RoutersSpec extends ScalaTestWithActorTestKit(""" akka.loglevel=debug - """) with WordSpecLike with Matchers with LogCapturing { + """) with AnyWordSpecLike with Matchers with LogCapturing { // needed for the event filter implicit val classicSystem: ActorSystem = system.toClassic diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashBufferSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashBufferSpec.scala index 6b13438467..484b1ae7e2 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashBufferSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashBufferSpec.scala @@ -8,9 +8,10 @@ import akka.actor.typed.Behavior import akka.actor.testkit.typed.internal.StubbedActorContext import akka.actor.testkit.typed.scaladsl.TestInbox import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class StashBufferSpec extends WordSpec with Matchers with LogCapturing { +class StashBufferSpec extends AnyWordSpec with Matchers with LogCapturing { val context = new StubbedActorContext[String]( "StashBufferSpec", diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala index 92eb284451..90edf7cbf6 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StashSpec.scala @@ -18,7 +18,7 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.eventstream.EventStream -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object AbstractStashSpec { sealed trait Command @@ -202,7 +202,7 @@ class MutableStashSpec extends AbstractStashSpec { } } -abstract class AbstractStashSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +abstract class AbstractStashSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import AbstractStashSpec._ def testQualifier: String @@ -257,7 +257,7 @@ abstract class AbstractStashSpec extends ScalaTestWithActorTestKit with WordSpec } -class UnstashingSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class UnstashingSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { private def slowStoppingChild(latch: CountDownLatch): Behavior[String] = Behaviors.receiveSignal { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StopSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StopSpec.scala index d4280f77bc..26533a1e78 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StopSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/StopSpec.scala @@ -12,9 +12,9 @@ import akka.actor.typed import akka.actor.typed.Behavior import akka.actor.typed.BehaviorInterceptor import akka.actor.typed.PostStop -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class StopSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class StopSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import BehaviorInterceptor._ "Stopping an actor" should { diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala index 43699918c8..0064d8760d 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/AdapterSpec.scala @@ -21,7 +21,9 @@ import akka.actor.testkit.typed.scaladsl.LoggingTestKit import akka.actor.typed.internal.adapter.SchedulerAdapter import akka.serialization.SerializationExtension import akka.{ actor => classic } -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpec } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object AdapterSpec { val classic1: classic.Props = classic.Props(new Classic1) @@ -179,7 +181,7 @@ object AdapterSpec { } -class AdapterSpec extends WordSpec with Matchers with BeforeAndAfterAll with LogCapturing { +class AdapterSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with LogCapturing { import AdapterSpec._ implicit val system = akka.actor.ActorSystem("AdapterSpec") diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala index f772180b0e..31b442f6ad 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/adapter/GuardianStartupSpec.scala @@ -12,11 +12,11 @@ import akka.actor.testkit.typed.scaladsl.ActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.ActorSystem import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.Matchers -import org.scalatest.WordSpec import org.scalatest.concurrent.ScalaFutures +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class GuardianStartupSpec extends WordSpec with Matchers with ScalaFutures with LogCapturing { +class GuardianStartupSpec extends AnyWordSpec with Matchers with ScalaFutures with LogCapturing { "The user guardian" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/AggregatorSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/AggregatorSpec.scala index d6206f3633..b8f36c1674 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/AggregatorSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/AggregatorSpec.scala @@ -5,13 +5,12 @@ package docs.akka.typed import scala.concurrent.duration._ - import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.typed.ActorRef import akka.actor.typed.Behavior import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object AggregatorSpec { object IllustrateUsage { @@ -69,7 +68,7 @@ object AggregatorSpec { } } -class AggregatorSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class AggregatorSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Aggregator" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/DispatchersDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/DispatchersDocSpec.scala index 8508470c65..d2cfd82579 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/DispatchersDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/DispatchersDocSpec.scala @@ -13,9 +13,8 @@ import akka.dispatch.Dispatcher import DispatchersDocSpec._ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike import scala.concurrent.Future - import akka.actor.testkit.typed.scaladsl.LogCapturing object DispatchersDocSpec { @@ -60,7 +59,7 @@ object DispatchersDocSpec { class DispatchersDocSpec extends ScalaTestWithActorTestKit(DispatchersDocSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "Actor Dispatchers" should { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FSMDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FSMDocSpec.scala index d2d0ae15eb..8df729b20f 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FSMDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FSMDocSpec.scala @@ -7,12 +7,12 @@ package docs.akka.typed import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.{ ActorRef, Behavior } + import scala.collection.immutable import scala.concurrent.duration._ - import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object FSMDocSpec { @@ -73,7 +73,7 @@ object FSMDocSpec { //#simple-state } -class FSMDocSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class FSMDocSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import FSMDocSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FaultToleranceDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FaultToleranceDocSpec.scala index 35457deee4..c1d62b3de2 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FaultToleranceDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/FaultToleranceDocSpec.scala @@ -7,7 +7,7 @@ package docs.akka.typed import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import com.github.ghik.silencer.silent -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object FaultToleranceDocSpec { // #bubbling-example @@ -81,7 +81,7 @@ object FaultToleranceDocSpec { class FaultToleranceDocSpec extends ScalaTestWithActorTestKit(""" # silenced to not put noise in test logs akka.loglevel = off - """) with WordSpecLike { + """) with AnyWordSpecLike { import FaultToleranceDocSpec._ "Bubbling of failures" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/GracefulStopDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/GracefulStopDocSpec.scala index 2f1360ef0f..ea8f8c9f10 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/GracefulStopDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/GracefulStopDocSpec.scala @@ -16,7 +16,7 @@ import akka.actor.typed.ActorRef import org.slf4j.Logger import scala.concurrent.duration._ import scala.concurrent.Await -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike import akka.actor.typed.Terminated import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -132,7 +132,7 @@ object GracefulStopDocSpec { } -class GracefulStopDocSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class GracefulStopDocSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import GracefulStopDocSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/InteractionPatternsSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/InteractionPatternsSpec.scala index f67650c045..f395d4cc8b 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/InteractionPatternsSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/InteractionPatternsSpec.scala @@ -10,7 +10,6 @@ import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success - import akka.Done import akka.NotUsed import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit @@ -21,9 +20,9 @@ import akka.actor.typed.Behavior import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.LoggerOps import akka.actor.typed.scaladsl.TimerScheduler -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class InteractionPatternsSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class InteractionPatternsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "The interaction patterns docs" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/IntroSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/IntroSpec.scala index 1b0eaa8148..ecfe1a77b5 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/IntroSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/IntroSpec.scala @@ -17,7 +17,7 @@ import akka.Done import akka.actor.typed.{ DispatcherSelector, Terminated } import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike import akka.actor.testkit.typed.scaladsl.ActorTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import java.net.URLEncoder @@ -223,7 +223,7 @@ object IntroSpec { } -class IntroSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class IntroSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import IntroSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/MailboxDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/MailboxDocSpec.scala index 7b39235c2f..e2200b5ccd 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/MailboxDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/MailboxDocSpec.scala @@ -11,11 +11,11 @@ import akka.actor.typed.Behavior import akka.actor.typed.MailboxSelector import akka.actor.typed.scaladsl.Behaviors import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class MailboxDocSpec extends ScalaTestWithActorTestKit(ConfigFactory.load("mailbox-config-sample.conf")) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "Specifying mailbox through props" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/OOIntroSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/OOIntroSpec.scala index 79028088aa..af9b82413d 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/OOIntroSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/OOIntroSpec.scala @@ -18,7 +18,7 @@ import java.net.URLEncoder import java.nio.charset.StandardCharsets import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object OOIntroSpec { @@ -145,7 +145,7 @@ object OOIntroSpec { } -class OOIntroSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class OOIntroSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import OOIntroSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala index 6cf6c79249..8b48f37312 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala @@ -10,7 +10,7 @@ import akka.actor.testkit.typed.scaladsl.{ LogCapturing, ScalaTestWithActorTestK import akka.actor.typed.{ Behavior, SupervisorStrategy } import akka.actor.typed.receptionist.{ Receptionist, ServiceKey } import akka.actor.typed.scaladsl.{ Behaviors, Routers } -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike // #pool @@ -39,7 +39,7 @@ object RouterSpec { // #group } -class RouterSpec extends ScalaTestWithActorTestKit("akka.loglevel=warning") with WordSpecLike with LogCapturing { +class RouterSpec extends ScalaTestWithActorTestKit("akka.loglevel=warning") with AnyWordSpecLike with LogCapturing { import RouterSpec._ "The routing sample" must { diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/SpawnProtocolDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/SpawnProtocolDocSpec.scala index 23bc2f8a44..ec7acfb778 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/SpawnProtocolDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/SpawnProtocolDocSpec.scala @@ -7,12 +7,11 @@ package docs.akka.typed import scala.concurrent.ExecutionContext import scala.concurrent.Future import scala.concurrent.duration._ - import akka.actor.testkit.typed.scaladsl.ActorTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import docs.akka.typed.IntroSpec.HelloWorld -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike import com.github.ghik.silencer.silent //#imports1 @@ -48,7 +47,7 @@ object SpawnProtocolDocSpec { //#main } -class SpawnProtocolDocSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class SpawnProtocolDocSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import SpawnProtocolDocSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/StashDocSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/StashDocSpec.scala index e867d9b3fa..f64ce71f22 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/StashDocSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/StashDocSpec.scala @@ -6,7 +6,7 @@ package docs.akka.typed import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object StashDocSpec { // #stashing @@ -100,7 +100,7 @@ object StashDocSpec { // #stashing } -class StashDocSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class StashDocSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { import StashDocSpec.DB import StashDocSpec.DataAccess import scala.concurrent.Future diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala index 07f1830050..a4e1a18c49 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/ClassicWatchingTypedSpec.scala @@ -17,7 +17,7 @@ import akka.testkit.TestProbe //#import-alias import akka.{ actor => classic } //#import-alias -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec import scala.concurrent.duration._ @@ -73,7 +73,7 @@ object ClassicWatchingTypedSpec { //#typed } -class ClassicWatchingTypedSpec extends WordSpec with LogCapturing { +class ClassicWatchingTypedSpec extends AnyWordSpec with LogCapturing { import ClassicWatchingTypedSpec._ diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala index 36678e4ed3..8109fea9d9 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/coexistence/TypedWatchingClassicSpec.scala @@ -17,7 +17,7 @@ import akka.testkit.TestProbe //#import-alias import akka.{ actor => classic } //#import-alias -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec import scala.concurrent.duration._ object TypedWatchingClassicSpec { @@ -68,7 +68,7 @@ object TypedWatchingClassicSpec { //#classic } -class TypedWatchingClassicSpec extends WordSpec with LogCapturing { +class TypedWatchingClassicSpec extends AnyWordSpec with LogCapturing { import TypedWatchingClassicSpec._ diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala index 12d4b49fd3..fa990f9a5a 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/ClusterMetricsRoutingSpec.scala @@ -4,13 +4,12 @@ package akka.cluster.metrics -import org.scalatest.WordSpec -import org.scalatest.Matchers - import akka.actor.Address import akka.cluster.metrics.StandardMetrics._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MetricsSelectorSpec extends WordSpec with Matchers { +class MetricsSelectorSpec extends AnyWordSpec with Matchers { val factor = 0.3 // TODO read from reference.conf diff --git a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala index e5302b457b..a11883a092 100644 --- a/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala +++ b/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala @@ -4,8 +4,6 @@ package akka.cluster.metrics -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.cluster.metrics.StandardMetrics._ import scala.util.Failure @@ -15,9 +13,11 @@ import akka.testkit.ImplicitSender import java.lang.System.{ currentTimeMillis => newTimestamp } import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec @silent -class MetricNumericConverterSpec extends WordSpec with Matchers with MetricNumericConverter { +class MetricNumericConverterSpec extends AnyWordSpec with Matchers with MetricNumericConverter { "MetricNumericConverter" must { @@ -56,7 +56,7 @@ class MetricNumericConverterSpec extends WordSpec with Matchers with MetricNumer } @silent -class NodeMetricsSpec extends WordSpec with Matchers { +class NodeMetricsSpec extends AnyWordSpec with Matchers { val node1 = Address("akka", "sys", "a", 2554) val node2 = Address("akka", "sys", "a", 2555) diff --git a/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java b/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java index ca0a88f1a1..e80d1f9d49 100644 --- a/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java +++ b/akka-cluster-sharding-typed/src/test/java/akka/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java @@ -21,7 +21,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletionStage; diff --git a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleDocTest.java b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleDocTest.java index 8083a97ddb..fed8e634b8 100644 --- a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleDocTest.java +++ b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleDocTest.java @@ -20,7 +20,7 @@ import akka.persistence.typed.PersistenceId; // #test -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static jdocs.akka.cluster.sharding.typed.AccountExampleWithEventHandlersInState.AccountEntity; diff --git a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleTest.java b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleTest.java index d6d1587350..fd3c757067 100644 --- a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleTest.java +++ b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/AccountExampleTest.java @@ -19,7 +19,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.math.BigDecimal; import java.time.Duration; diff --git a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java index 89a09d9472..bf6a6ed251 100644 --- a/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java +++ b/akka-cluster-sharding-typed/src/test/java/jdocs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java @@ -18,7 +18,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static jdocs.akka.cluster.sharding.typed.HelloWorldPersistentEntityExample.*; import static org.junit.Assert.assertEquals; diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala index 21b1845047..c4b2b164e8 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/JoinConfigCompatCheckerClusterShardingSpec.scala @@ -11,11 +11,12 @@ import akka.actor.typed.ActorSystem import akka.cluster.{ Cluster => ClassicCluster } import akka.testkit.LongRunningTest import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ Matchers, WordSpecLike } import scala.collection.{ immutable => im } import scala.concurrent.duration._ import scala.util.Try +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object JoinConfig { @@ -40,7 +41,7 @@ object JoinConfig { abstract class JoinConfigCompatCheckerClusterShardingSpec extends ScalaTestWithActorTestKit(JoinConfig.joinConfig(JoinConfig.Shards)) - with WordSpecLike + with AnyWordSpecLike with Matchers with LogCapturing { diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala index 0e2c592fe0..e1d3d59c6a 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/ShardingSerializerSpec.scala @@ -9,9 +9,9 @@ import akka.cluster.sharding.typed.internal.ShardingSerializer import akka.serialization.SerializationExtension import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class ShardingSerializerSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class ShardingSerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "The typed ShardingSerializer" must { diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala index ae9995ff4a..06ceb54bf2 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala @@ -34,7 +34,7 @@ import akka.persistence.typed.RecoveryCompleted import akka.persistence.typed.scaladsl.Effect import akka.persistence.typed.scaladsl.EventSourcedBehavior import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ClusterShardingPersistenceSpec { val config = ConfigFactory.parseString(""" @@ -145,7 +145,7 @@ object ClusterShardingPersistenceSpec { class ClusterShardingPersistenceSpec extends ScalaTestWithActorTestKit(ClusterShardingPersistenceSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import ClusterShardingPersistenceSpec._ diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala index daadeda32d..fa2d001833 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala @@ -28,7 +28,7 @@ import akka.serialization.jackson.CborSerializable import akka.util.Timeout import akka.util.ccompat._ import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike @ccompatUsedUntil213 object ClusterShardingSpec { @@ -113,7 +113,7 @@ object ClusterShardingSpec { class ClusterShardingSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import ClusterShardingSpec._ diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala index 088d760b87..48d575f7dc 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingStateSpec.scala @@ -11,11 +11,11 @@ import akka.cluster.sharding.ShardRegion.{ CurrentShardRegionState, ShardState } import akka.cluster.sharding.typed.scaladsl.ClusterShardingSpec._ import akka.cluster.sharding.typed.{ GetShardRegionState, ShardingMessageExtractor } import akka.cluster.typed.{ Cluster, Join } -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class ClusterShardingStateSpec extends ScalaTestWithActorTestKit(ClusterShardingSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { val sharding = ClusterSharding(system) diff --git a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleDocSpec.scala b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleDocSpec.scala index b6b362ccdc..b2e528ee4b 100644 --- a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleDocSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleDocSpec.scala @@ -10,7 +10,7 @@ import java.util.UUID import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.persistence.typed.PersistenceId -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike //#test @@ -38,7 +38,7 @@ class AccountExampleDocSpec extends ScalaTestWithActorTestKit(s""" akka.persistence.journal.plugin = "akka.persistence.journal.inmem" akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local" akka.persistence.snapshot-store.local.dir = "target/snapshot-${UUID.randomUUID().toString}" - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { "Account" must { diff --git a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala index f6b4fab1f8..42a954b749 100644 --- a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala @@ -6,7 +6,6 @@ package docs.akka.cluster.sharding.typed import scala.concurrent.ExecutionContext import scala.concurrent.Future - import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.cluster.sharding.typed.scaladsl.ClusterSharding @@ -15,7 +14,7 @@ import akka.cluster.typed.Cluster import akka.cluster.typed.Join import akka.persistence.typed.PersistenceId import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object AccountExampleSpec { val config = ConfigFactory.parseString(""" @@ -33,7 +32,7 @@ object AccountExampleSpec { class AccountExampleSpec extends ScalaTestWithActorTestKit(AccountExampleSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import AccountExampleWithEventHandlersInState.AccountEntity import AccountExampleWithEventHandlersInState.AccountEntity._ diff --git a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala index a7ce61cfd5..87184a1640 100644 --- a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleSpec.scala @@ -12,7 +12,7 @@ import akka.cluster.typed.Cluster import akka.cluster.typed.Join import akka.persistence.typed.PersistenceId import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object HelloWorldEventSourcedEntityExampleSpec { val config = ConfigFactory.parseString(""" @@ -29,7 +29,7 @@ object HelloWorldEventSourcedEntityExampleSpec { class HelloWorldEventSourcedEntityExampleSpec extends ScalaTestWithActorTestKit(HelloWorldEventSourcedEntityExampleSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import HelloWorldPersistentEntityExample.HelloWorld import HelloWorldPersistentEntityExample.HelloWorld._ diff --git a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/PersistentShardSpec.scala b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/PersistentShardSpec.scala index 8d37b18a3c..592c017e90 100644 --- a/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/PersistentShardSpec.scala +++ b/akka-cluster-sharding/src/test/scala/akka/cluster/sharding/PersistentShardSpec.scala @@ -10,7 +10,7 @@ import akka.cluster.sharding.Shard.{ GetShardStats, ShardStats } import akka.cluster.sharding.ShardRegion.{ StartEntity, StartEntityAck } import akka.testkit.{ AkkaSpec, ImplicitSender } import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object PersistentShardSpec { class EntityActor extends Actor { @@ -24,7 +24,7 @@ object PersistentShardSpec { """.stripMargin) } -class PersistentShardSpec extends AkkaSpec(PersistentShardSpec.config) with WordSpecLike with ImplicitSender { +class PersistentShardSpec extends AkkaSpec(PersistentShardSpec.config) with AnyWordSpecLike with ImplicitSender { "Persistent Shard" must { diff --git a/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java b/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java index f0a875f7fc..026f1fbb56 100644 --- a/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java +++ b/akka-cluster-tools/src/test/java/akka/cluster/client/ClusterClientTest.java @@ -13,7 +13,7 @@ import org.junit.ClassRule; import org.junit.Test; import akka.testkit.AkkaJUnitActorSystemResource; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class ClusterClientTest extends JUnitSuite { diff --git a/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java b/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java index f06ba24e9f..89fa06ecdb 100644 --- a/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java +++ b/akka-cluster-tools/src/test/java/akka/cluster/pubsub/DistributedPubSubMediatorTest.java @@ -17,7 +17,7 @@ import akka.actor.Props; import akka.actor.AbstractActor; import akka.event.Logging; import akka.event.LoggingAdapter; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class DistributedPubSubMediatorTest extends JUnitSuite { diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala index 88a3294166..45d129a51b 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/pubsub/DistributedPubSubMediatorRouterSpec.scala @@ -6,9 +6,9 @@ package akka.cluster.pubsub import akka.testkit._ import akka.routing.{ ConsistentHashingRoutingLogic, RouterEnvelope } -import org.scalatest.WordSpecLike import akka.actor.ActorRef import com.typesafe.config.ConfigFactory +import org.scalatest.wordspec.AnyWordSpecLike case class WrappedMessage(msg: String) extends RouterEnvelope { override def message = msg @@ -27,7 +27,7 @@ object DistributedPubSubMediatorRouterSpec { """ } -trait DistributedPubSubMediatorRouterSpec { this: WordSpecLike with TestKit with ImplicitSender => +trait DistributedPubSubMediatorRouterSpec { this: AnyWordSpecLike with TestKit with ImplicitSender => def nonUnwrappingPubSub(mediator: ActorRef, testActor: ActorRef, msg: Any): Unit = { val path = testActor.path.toStringWithoutAddress diff --git a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala index 9ccceebb18..56cba45dd8 100644 --- a/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala +++ b/akka-cluster-tools/src/test/scala/akka/cluster/singleton/ClusterSingletonProxySpec.scala @@ -4,14 +4,16 @@ package akka.cluster.singleton -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } import akka.testkit.{ TestKit, TestProbe } import akka.actor._ import com.typesafe.config.ConfigFactory import akka.cluster.Cluster import scala.concurrent.duration._ +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class ClusterSingletonProxySpec extends WordSpecLike with Matchers with BeforeAndAfterAll { +class ClusterSingletonProxySpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { import ClusterSingletonProxySpec._ diff --git a/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java b/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java index 1230a7ef64..26a1cb14c0 100644 --- a/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java +++ b/akka-cluster-typed/src/test/java/akka/cluster/typed/ClusterApiTest.java @@ -10,7 +10,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.TimeUnit; diff --git a/akka-cluster-typed/src/test/java/jdocs/akka/cluster/ddata/typed/javadsl/ReplicatorDocTest.java b/akka-cluster-typed/src/test/java/jdocs/akka/cluster/ddata/typed/javadsl/ReplicatorDocTest.java index ed83834842..80323554af 100644 --- a/akka-cluster-typed/src/test/java/jdocs/akka/cluster/ddata/typed/javadsl/ReplicatorDocTest.java +++ b/akka-cluster-typed/src/test/java/jdocs/akka/cluster/ddata/typed/javadsl/ReplicatorDocTest.java @@ -18,7 +18,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala index cfdffd9826..718aac7d96 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/ddata/typed/scaladsl/ReplicatorSpec.scala @@ -6,9 +6,9 @@ package akka.cluster.ddata.typed.scaladsl import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class ReplicatorSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class ReplicatorSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "Replicator" must { "have the prefixed replicator name" in { ReplicatorSettings.name(system) should ===("typedDdataReplicator") diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala index a446b16ca1..ecd0f9f216 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ActorSystemSpec.scala @@ -30,6 +30,8 @@ import org.scalatest._ import org.scalatest.concurrent.Eventually import org.scalatest.concurrent.ScalaFutures import org.scalatest.time.Span +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object ActorSystemSpec { @@ -58,7 +60,7 @@ object ActorSystemSpec { } class ActorSystemSpec - extends WordSpec + extends AnyWordSpec with Matchers with BeforeAndAfterAll with ScalaFutures diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterActorLoggingSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterActorLoggingSpec.scala index 17155a8b58..225a1e3074 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterActorLoggingSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterActorLoggingSpec.scala @@ -11,8 +11,8 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.typed.internal.ActorMdc import akka.actor.typed.scaladsl.Behaviors import com.typesafe.config.ConfigFactory -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object ClusterActorLoggingSpec { def config = ConfigFactory.parseString(""" @@ -25,7 +25,7 @@ object ClusterActorLoggingSpec { class ClusterActorLoggingSpec extends ScalaTestWithActorTestKit(ClusterActorLoggingSpec.config) - with WordSpecLike + with AnyWordSpecLike with Matchers with LogCapturing { diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala index c96cf31f5d..d8f979dac2 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterApiSpec.scala @@ -14,7 +14,7 @@ import akka.actor.testkit.typed.scaladsl.ActorTestKit import com.typesafe.config.ConfigFactory import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ClusterApiSpec { val config = @@ -33,7 +33,7 @@ object ClusterApiSpec { """) } -class ClusterApiSpec extends ScalaTestWithActorTestKit(ClusterApiSpec.config) with WordSpecLike with LogCapturing { +class ClusterApiSpec extends ScalaTestWithActorTestKit(ClusterApiSpec.config) with AnyWordSpecLike with LogCapturing { val testSettings = TestKitSettings(system) val clusterNode1 = Cluster(system) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala index f598b0d072..c8feaa0160 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonApiSpec.scala @@ -16,7 +16,7 @@ import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.adapter._ import akka.serialization.jackson.CborSerializable import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ClusterSingletonApiSpec { @@ -50,7 +50,7 @@ object ClusterSingletonApiSpec { class ClusterSingletonApiSpec extends ScalaTestWithActorTestKit(ClusterSingletonApiSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import ClusterSingletonApiSpec._ diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala index 5f43c9786a..fa274078ee 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPersistenceSpec.scala @@ -11,7 +11,7 @@ import akka.actor.testkit.typed.scaladsl.TestProbe import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.persistence.typed.PersistenceId import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ClusterSingletonPersistenceSpec { val config = ConfigFactory.parseString(""" @@ -49,7 +49,7 @@ object ClusterSingletonPersistenceSpec { class ClusterSingletonPersistenceSpec extends ScalaTestWithActorTestKit(ClusterSingletonPersistenceSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import ClusterSingletonPersistenceSpec._ import akka.actor.typed.scaladsl.adapter._ diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala index 64c8f0897f..3cf7185080 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/ClusterSingletonPoisonPillSpec.scala @@ -11,10 +11,10 @@ import akka.actor.typed.{ ActorRef, Behavior } import akka.actor.typed.scaladsl.Behaviors import akka.actor.typed.scaladsl.adapter._ import akka.cluster.typed.ClusterSingletonPoisonPillSpec.GetSelf -import org.scalatest.WordSpecLike import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.LogCapturing +import org.scalatest.wordspec.AnyWordSpecLike object ClusterSingletonPoisonPillSpec { @@ -28,7 +28,7 @@ object ClusterSingletonPoisonPillSpec { class ClusterSingletonPoisonPillSpec extends ScalaTestWithActorTestKit(ClusterSingletonApiSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { implicit val testSettings = TestKitSettings(system) diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala index 301034f12e..da4cd5d396 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/GroupRouterSpec.scala @@ -11,9 +11,9 @@ import akka.actor.typed.scaladsl.{ Behaviors, GroupRouter, Routers } import akka.serialization.jackson.CborSerializable import akka.util.Timeout import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike import scala.concurrent.Promise +import org.scalatest.wordspec.AnyWordSpecLike object GroupRouterSpec { def config = ConfigFactory.parseString(s""" @@ -62,7 +62,7 @@ object GroupRouterSpec { } -class GroupRouterSpec extends ScalaTestWithActorTestKit(GroupRouterSpec.config) with WordSpecLike with LogCapturing { +class GroupRouterSpec extends ScalaTestWithActorTestKit(GroupRouterSpec.config) with AnyWordSpecLike with LogCapturing { import GroupRouterSpec._ def checkGroupRouterBehavior[T](groupRouter: GroupRouter[Ping.type], settings: GroupRouterSpecSettings)( diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala index bb37996441..7be06e03f5 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteContextAskSpec.scala @@ -20,7 +20,7 @@ import akka.actor.typed.scaladsl.Behaviors import akka.serialization.jackson.CborSerializable import akka.util.Timeout import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object RemoteContextAskSpec { def config = ConfigFactory.parseString(s""" @@ -55,7 +55,7 @@ object RemoteContextAskSpec { class RemoteContextAskSpec extends ScalaTestWithActorTestKit(RemoteContextAskSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import RemoteContextAskSpec._ diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala index 9a24a9b881..613c02977f 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/RemoteDeployNotAllowedSpec.scala @@ -13,7 +13,7 @@ import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.ActorTestKit import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object RemoteDeployNotAllowedSpec { def config = ConfigFactory.parseString(s""" @@ -44,7 +44,7 @@ object RemoteDeployNotAllowedSpec { class RemoteDeployNotAllowedSpec extends ScalaTestWithActorTestKit(RemoteDeployNotAllowedSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "Typed cluster" must { diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala index fd74b73f82..470c783c0c 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/AkkaClusterTypedSerializerSpec.scala @@ -11,9 +11,9 @@ import akka.serialization.SerializationExtension import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.actor.typed.scaladsl.Behaviors -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class AkkaClusterTypedSerializerSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class AkkaClusterTypedSerializerSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { val ref = spawn(Behaviors.empty[String]) val classicSystem = system.toClassic diff --git a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala index 33d5138cba..365568228c 100644 --- a/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala +++ b/akka-cluster-typed/src/test/scala/akka/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala @@ -25,8 +25,8 @@ import akka.cluster.typed.JoinSeedNodes import akka.cluster.typed.Leave import akka.serialization.jackson.CborSerializable import com.typesafe.config.ConfigFactory -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object ClusterReceptionistSpec { val config = ConfigFactory.parseString(s""" @@ -69,7 +69,7 @@ object ClusterReceptionistSpec { val AnotherKey = ServiceKey[PingProtocol]("pingy-2") } -class ClusterReceptionistSpec extends WordSpec with Matchers with LogCapturing { +class ClusterReceptionistSpec extends AnyWordSpec with Matchers with LogCapturing { import ClusterReceptionistSpec._ import Receptionist._ diff --git a/akka-cluster-typed/src/test/scala/docs/akka/cluster/ddata/typed/scaladsl/ReplicatorDocSpec.scala b/akka-cluster-typed/src/test/scala/docs/akka/cluster/ddata/typed/scaladsl/ReplicatorDocSpec.scala index e3ef81cca7..4c7e845132 100644 --- a/akka-cluster-typed/src/test/scala/docs/akka/cluster/ddata/typed/scaladsl/ReplicatorDocSpec.scala +++ b/akka-cluster-typed/src/test/scala/docs/akka/cluster/ddata/typed/scaladsl/ReplicatorDocSpec.scala @@ -8,10 +8,9 @@ import scala.concurrent.duration._ import akka.cluster.ddata.SelfUniqueAddress import akka.cluster.ddata.typed.scaladsl.DistributedData import akka.cluster.ddata.typed.scaladsl.Replicator -import org.scalatest.WordSpecLike - import akka.actor.testkit.typed.scaladsl._ import com.typesafe.config.ConfigFactory +import org.scalatest.wordspec.AnyWordSpecLike // #sample import akka.actor.typed.ActorRef @@ -113,7 +112,7 @@ object ReplicatorDocSpec { class ReplicatorDocSpec extends ScalaTestWithActorTestKit(ReplicatorDocSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import ReplicatorDocSpec._ diff --git a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala index fb9afce7e5..09db42afec 100644 --- a/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala +++ b/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala @@ -8,7 +8,8 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.testkit.SocketUtil import com.github.ghik.silencer.silent import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.wordspec.AnyWordSpec +import org.scalatest.matchers.should.Matchers //#cluster-imports import akka.actor.typed._ import akka.actor.typed.scaladsl._ @@ -102,7 +103,7 @@ akka { } } -class BasicClusterConfigSpec extends WordSpec with ScalaFutures with Eventually with Matchers with LogCapturing { +class BasicClusterConfigSpec extends AnyWordSpec with ScalaFutures with Eventually with Matchers with LogCapturing { import BasicClusterExampleSpec._ implicit override val patienceConfig = @@ -156,7 +157,7 @@ akka { } -class BasicClusterManualSpec extends WordSpec with ScalaFutures with Eventually with Matchers with LogCapturing { +class BasicClusterManualSpec extends AnyWordSpec with ScalaFutures with Eventually with Matchers with LogCapturing { import BasicClusterManualSpec._ diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala index d2193497ea..f56516eca5 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterDomainEventSpec.scala @@ -4,13 +4,13 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address import scala.collection.immutable.SortedSet +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ClusterDomainEventSpec extends WordSpec with Matchers { +class ClusterDomainEventSpec extends AnyWordSpec with Matchers { import MemberStatus._ import ClusterEvent._ diff --git a/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala index 494a651984..8a0b6608c5 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ClusterHeartbeatSenderStateSpec.scala @@ -4,12 +4,12 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address import akka.remote.FailureDetector import akka.remote.DefaultFailureDetectorRegistry import java.util.concurrent.ThreadLocalRandom +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object ClusterHeartbeatSenderStateSpec { class FailureDetectorStub extends FailureDetector { @@ -37,7 +37,7 @@ object ClusterHeartbeatSenderStateSpec { } } -class ClusterHeartbeatSenderStateSpec extends WordSpec with Matchers { +class ClusterHeartbeatSenderStateSpec extends AnyWordSpec with Matchers { import ClusterHeartbeatSenderStateSpec._ val aa = UniqueAddress(Address("akka", "sys", "aa", 2552), 1L) diff --git a/akka-cluster/src/test/scala/akka/cluster/DowningProviderSpec.scala b/akka-cluster/src/test/scala/akka/cluster/DowningProviderSpec.scala index fb979b22ae..0bca5b5be3 100644 --- a/akka-cluster/src/test/scala/akka/cluster/DowningProviderSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/DowningProviderSpec.scala @@ -15,8 +15,8 @@ import akka.testkit.TestKit.awaitCond import akka.testkit.TestKit.shutdownActorSystem import akka.util.unused import com.typesafe.config.ConfigFactory -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec class FailingDowningProvider(@unused system: ActorSystem) extends DowningProvider { override val downRemovalMargin: FiniteDuration = 20.seconds @@ -35,7 +35,7 @@ class DummyDowningProvider(@unused system: ActorSystem) extends DowningProvider } } -class DowningProviderSpec extends WordSpec with Matchers { +class DowningProviderSpec extends AnyWordSpec with Matchers { val baseConf = ConfigFactory.parseString(""" akka { diff --git a/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala b/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala index b9998f1527..34159b3106 100644 --- a/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/GossipSpec.scala @@ -4,15 +4,15 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address import akka.cluster.Gossip.vclockName import akka.cluster.ClusterSettings.DefaultDataCenter import scala.collection.immutable.SortedSet +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class GossipSpec extends WordSpec with Matchers { +class GossipSpec extends AnyWordSpec with Matchers { import MemberStatus._ diff --git a/akka-cluster/src/test/scala/akka/cluster/GossipTargetSelectorSpec.scala b/akka-cluster/src/test/scala/akka/cluster/GossipTargetSelectorSpec.scala index cacba1aa09..80c99d8462 100644 --- a/akka-cluster/src/test/scala/akka/cluster/GossipTargetSelectorSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/GossipTargetSelectorSpec.scala @@ -7,11 +7,12 @@ package akka.cluster import akka.actor.Address import akka.cluster.ClusterSettings.DataCenter import akka.cluster.MemberStatus.Up -import org.scalatest.{ Matchers, WordSpec } import scala.collection.immutable.SortedSet +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class GossipTargetSelectorSpec extends WordSpec with Matchers { +class GossipTargetSelectorSpec extends AnyWordSpec with Matchers { val aDc1 = TestMember(Address("akka", "sys", "a", 2552), Up, Set.empty, dataCenter = "dc1") val bDc1 = TestMember(Address("akka", "sys", "b", 2552), Up, Set.empty, dataCenter = "dc1") diff --git a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala index e2676003d8..e2d7249385 100644 --- a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingPerfSpec.scala @@ -4,11 +4,11 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class HeartbeatNodeRingPerfSpec extends WordSpec with Matchers { +class HeartbeatNodeRingPerfSpec extends AnyWordSpec with Matchers { val nodesSize = sys.props.get("akka.cluster.HeartbeatNodeRingPerfSpec.nodesSize").getOrElse("250").toInt // increase for serious measurements diff --git a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala index 785bc66aa0..e476b92b42 100644 --- a/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/HeartbeatNodeRingSpec.scala @@ -4,11 +4,11 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class HeartbeatNodeRingSpec extends WordSpec with Matchers { +class HeartbeatNodeRingSpec extends AnyWordSpec with Matchers { val aa = UniqueAddress(Address("akka", "sys", "aa", 2552), 1L) val bb = UniqueAddress(Address("akka", "sys", "bb", 2552), 2L) diff --git a/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatPreDefinedChecksSpec.scala b/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatPreDefinedChecksSpec.scala index 708460b8ca..8adf879554 100644 --- a/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatPreDefinedChecksSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/JoinConfigCompatPreDefinedChecksSpec.scala @@ -5,11 +5,12 @@ package akka.cluster import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ Matchers, WordSpec } import scala.collection.{ immutable => im } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class JoinConfigCompatPreDefinedChecksSpec extends WordSpec with Matchers { +class JoinConfigCompatPreDefinedChecksSpec extends AnyWordSpec with Matchers { // Test for some of the pre-build helpers we offer "JoinConfigCompatChecker.exists" must { diff --git a/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala index ced0f03428..33bc9eab7c 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MemberOrderingSpec.scala @@ -5,12 +5,12 @@ package akka.cluster import akka.actor.{ Address, AddressFromURIString } -import org.scalatest.Matchers -import org.scalatest.WordSpec import scala.collection.immutable.SortedSet import scala.util.Random +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MemberOrderingSpec extends WordSpec with Matchers { +class MemberOrderingSpec extends AnyWordSpec with Matchers { import Member.ordering import Member.addressOrdering import MemberStatus._ diff --git a/akka-cluster/src/test/scala/akka/cluster/MembershipStateSpec.scala b/akka-cluster/src/test/scala/akka/cluster/MembershipStateSpec.scala index 899c7dd9d5..ed817f162e 100644 --- a/akka-cluster/src/test/scala/akka/cluster/MembershipStateSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/MembershipStateSpec.scala @@ -6,11 +6,12 @@ package akka.cluster import akka.actor.Address import akka.cluster.MemberStatus.Up -import org.scalatest.{ Matchers, WordSpec } import scala.collection.immutable.SortedSet +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MembershipStateSpec extends WordSpec with Matchers { +class MembershipStateSpec extends AnyWordSpec with Matchers { // DC-a is in reverse age order val a1 = TestMember(Address("akka", "sys", "a4", 2552), Up, 1, "dc-a") val a2 = TestMember(Address("akka", "sys", "a3", 2552), Up, 2, "dc-a") diff --git a/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala index 0035e3154d..171303c7a8 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ReachabilityPerfSpec.scala @@ -4,12 +4,12 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ReachabilityPerfSpec extends WordSpec with Matchers { +class ReachabilityPerfSpec extends AnyWordSpec with Matchers { val nodesSize = sys.props.get("akka.cluster.ReachabilityPerfSpec.nodesSize").getOrElse("250").toInt // increase for serious measurements diff --git a/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala b/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala index 8abaaca168..699183ba77 100644 --- a/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/ReachabilitySpec.scala @@ -4,11 +4,11 @@ package akka.cluster -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor.Address +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ReachabilitySpec extends WordSpec with Matchers { +class ReachabilitySpec extends AnyWordSpec with Matchers { import Reachability.{ Reachable, Record, Terminated, Unreachable } diff --git a/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala b/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala index f9ba64b3ee..0c3eb6a330 100644 --- a/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala +++ b/akka-cluster/src/test/scala/akka/cluster/VectorClockPerfSpec.scala @@ -5,8 +5,8 @@ package akka.cluster import scala.collection.immutable.{ SortedSet, TreeMap } -import org.scalatest.WordSpec -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object VectorClockPerfSpec { import VectorClock._ @@ -27,7 +27,7 @@ object VectorClockPerfSpec { } -class VectorClockPerfSpec extends WordSpec with Matchers { +class VectorClockPerfSpec extends AnyWordSpec with Matchers { import VectorClock._ import VectorClockPerfSpec._ diff --git a/akka-coordination/src/test/scala/akka/coordination/lease/TimeoutSettingsSpec.scala b/akka-coordination/src/test/scala/akka/coordination/lease/TimeoutSettingsSpec.scala index 7e90c8d997..a76b8173a2 100644 --- a/akka-coordination/src/test/scala/akka/coordination/lease/TimeoutSettingsSpec.scala +++ b/akka-coordination/src/test/scala/akka/coordination/lease/TimeoutSettingsSpec.scala @@ -5,11 +5,12 @@ package akka.coordination.lease import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } import scala.concurrent.duration._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class TimeoutSettingsSpec extends WordSpec with Matchers { +class TimeoutSettingsSpec extends AnyWordSpec with Matchers { private def conf(overrides: String): TimeoutSettings = { val c = ConfigFactory.parseString(overrides).withFallback(ConfigFactory.load()) TimeoutSettings(c) diff --git a/akka-discovery/src/test/scala/akka/discovery/DiscoveryConfigurationSpec.scala b/akka-discovery/src/test/scala/akka/discovery/DiscoveryConfigurationSpec.scala index 40cd60aa87..64aa1e393f 100644 --- a/akka-discovery/src/test/scala/akka/discovery/DiscoveryConfigurationSpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/DiscoveryConfigurationSpec.scala @@ -10,10 +10,10 @@ import akka.actor.ActorSystem import akka.discovery.ServiceDiscovery.Resolved import akka.testkit.TestKit import com.typesafe.config.ConfigFactory -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class DiscoveryConfigurationSpec extends WordSpec with Matchers { +class DiscoveryConfigurationSpec extends AnyWordSpec with Matchers { "ServiceDiscovery" should { "throw when no default discovery configured" in { diff --git a/akka-discovery/src/test/scala/akka/discovery/LookupSpec.scala b/akka-discovery/src/test/scala/akka/discovery/LookupSpec.scala index d132eac966..748ecdc7d0 100644 --- a/akka-discovery/src/test/scala/akka/discovery/LookupSpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/LookupSpec.scala @@ -4,9 +4,11 @@ package akka.discovery -import org.scalatest.{ Matchers, OptionValues, WordSpec } +import org.scalatest.OptionValues +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class LookupSpec extends WordSpec with Matchers with OptionValues { +class LookupSpec extends AnyWordSpec with Matchers with OptionValues { val (srvWithInvalidDomainNames, srvWithValidDomainNames) = { diff --git a/akka-discovery/src/test/scala/akka/discovery/aggregate/AggregateServiceDiscoverySpec.scala b/akka-discovery/src/test/scala/akka/discovery/aggregate/AggregateServiceDiscoverySpec.scala index 54992cf8d7..7b7d4e73c0 100644 --- a/akka-discovery/src/test/scala/akka/discovery/aggregate/AggregateServiceDiscoverySpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/aggregate/AggregateServiceDiscoverySpec.scala @@ -11,11 +11,13 @@ import akka.testkit.TestKit import akka.util.unused import com.typesafe.config.{ Config, ConfigFactory } import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } +import org.scalatest.BeforeAndAfterAll import scala.concurrent.Future import scala.concurrent.duration._ import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class StubbedServiceDiscovery(@unused system: ExtendedActorSystem) extends ServiceDiscovery { @@ -76,7 +78,7 @@ object AggregateServiceDiscoverySpec { class AggregateServiceDiscoverySpec extends TestKit(ActorSystem("AggregateDiscoverySpec", AggregateServiceDiscoverySpec.config)) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures { diff --git a/akka-discovery/src/test/scala/akka/discovery/config/ConfigServiceDiscoverySpec.scala b/akka-discovery/src/test/scala/akka/discovery/config/ConfigServiceDiscoverySpec.scala index 345e7641d8..ea9ae725ce 100644 --- a/akka-discovery/src/test/scala/akka/discovery/config/ConfigServiceDiscoverySpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/config/ConfigServiceDiscoverySpec.scala @@ -10,10 +10,12 @@ import akka.discovery.ServiceDiscovery.ResolvedTarget import akka.testkit.TestKit import com.typesafe.config.{ Config, ConfigFactory } import org.scalatest.concurrent.ScalaFutures -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } +import org.scalatest.BeforeAndAfterAll import scala.concurrent.duration._ import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object ConfigServiceDiscoverySpec { @@ -48,7 +50,7 @@ akka { class ConfigServiceDiscoverySpec extends TestKit(ActorSystem("ConfigDiscoverySpec", ConfigServiceDiscoverySpec.config)) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll with ScalaFutures { diff --git a/akka-discovery/src/test/scala/akka/discovery/config/ConfigServicesParserSpec.scala b/akka-discovery/src/test/scala/akka/discovery/config/ConfigServicesParserSpec.scala index ad3a9ae4f8..e7560e1010 100644 --- a/akka-discovery/src/test/scala/akka/discovery/config/ConfigServicesParserSpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/config/ConfigServicesParserSpec.scala @@ -7,9 +7,10 @@ package akka.discovery.config import akka.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget } import akka.discovery.config.ConfigServicesParserSpec._ import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ Matchers, WordSpec } import scala.collection.immutable +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object ConfigServicesParserSpec { val exampleConfig: Config = ConfigFactory.parseString(""" @@ -32,7 +33,7 @@ object ConfigServicesParserSpec { """.stripMargin) } -class ConfigServicesParserSpec extends WordSpec with Matchers { +class ConfigServicesParserSpec extends AnyWordSpec with Matchers { "Config parsing" must { "parse" in { diff --git a/akka-discovery/src/test/scala/akka/discovery/dns/DnsServiceDiscoverySpec.scala b/akka-discovery/src/test/scala/akka/discovery/dns/DnsServiceDiscoverySpec.scala index e3be6a7fce..0e4d2ff9d1 100644 --- a/akka-discovery/src/test/scala/akka/discovery/dns/DnsServiceDiscoverySpec.scala +++ b/akka-discovery/src/test/scala/akka/discovery/dns/DnsServiceDiscoverySpec.scala @@ -16,14 +16,14 @@ import akka.io.dns.CachePolicy.Ttl import akka.io.dns.{ AAAARecord, ARecord, DnsProtocol, SRVRecord } import akka.testkit.AkkaSpec import akka.testkit.TestProbe -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.concurrent.ScalaFutures -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers import scala.collection.{ immutable => im } import scala.concurrent.duration._ -class DnsServiceDiscoverySpec extends AkkaSpec with WordSpecLike with Matchers with ScalaFutures { +class DnsServiceDiscoverySpec extends AkkaSpec with AnyWordSpecLike with Matchers with ScalaFutures { "DnsServiceDiscovery" must { "fail future with DiscoveryTimeoutException if IP dns resolve does not respond" in { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/DataEnvelopeSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/DataEnvelopeSpec.scala index 5f1a6000e2..bd8bc85176 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/DataEnvelopeSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/DataEnvelopeSpec.scala @@ -6,11 +6,11 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress -import org.scalatest.Matchers -import org.scalatest.WordSpec import akka.cluster.ddata.Replicator.Internal.DataEnvelope +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class DataEnvelopeSpec extends WordSpec with Matchers { +class DataEnvelopeSpec extends AnyWordSpec with Matchers { import PruningState._ val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/DeltaPropagationSelectorSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/DeltaPropagationSelectorSpec.scala index f6dc097d2e..4b1a22bee3 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/DeltaPropagationSelectorSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/DeltaPropagationSelectorSpec.scala @@ -12,8 +12,8 @@ import akka.cluster.ddata.Replicator.Internal.Delta import akka.cluster.ddata.Replicator.Internal.DeltaPropagation import akka.cluster.ddata.Replicator.Internal.DeltaPropagation.NoDeltaPlaceholder import org.scalactic.TypeCheckedTripleEquals -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object DeltaPropagationSelectorSpec { class TestSelector(val selfUniqueAddress: UniqueAddress, override val allNodes: Vector[UniqueAddress]) @@ -31,7 +31,7 @@ object DeltaPropagationSelectorSpec { val deltaC = GSet.empty[String] + "c" } -class DeltaPropagationSelectorSpec extends WordSpec with Matchers with TypeCheckedTripleEquals { +class DeltaPropagationSelectorSpec extends AnyWordSpec with Matchers with TypeCheckedTripleEquals { import DeltaPropagationSelectorSpec._ val selfUniqueAddress = UniqueAddress(Address("akka", "Sys", "localhost", 4999), 17L) val nodes = (2500 until 2600).map(n => UniqueAddress(Address("akka", "Sys", "localhost", n), 17L)).toVector diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/FlagSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/FlagSpec.scala index ec049ae10a..1099f132eb 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/FlagSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/FlagSpec.scala @@ -5,10 +5,10 @@ package akka.cluster.ddata import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class FlagSpec extends WordSpec with Matchers { +class FlagSpec extends AnyWordSpec with Matchers { "A Flag" must { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/GCounterSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/GCounterSpec.scala index 58c20d561d..feb0fd310b 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/GCounterSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/GCounterSpec.scala @@ -7,10 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class GCounterSpec extends WordSpec with Matchers { +class GCounterSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) val node3 = UniqueAddress(node1.address.copy(port = Some(2553)), 3L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/GSetSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/GSetSpec.scala index 052e71053a..5095b1b343 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/GSetSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/GSetSpec.scala @@ -5,10 +5,10 @@ package akka.cluster.ddata import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class GSetSpec extends WordSpec with Matchers { +class GSetSpec extends AnyWordSpec with Matchers { val user1 = """{"username":"john","password":"coltrane"}""" val user2 = """{"username":"sonny","password":"rollins"}""" diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWMapSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWMapSpec.scala index 469b9c1f7a..14cfb99eb7 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWMapSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWMapSpec.scala @@ -7,10 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class LWWMapSpec extends WordSpec with Matchers { +class LWWMapSpec extends AnyWordSpec with Matchers { import LWWRegister.defaultClock val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWRegisterSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWRegisterSpec.scala index 39816371b9..6637ca485f 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWRegisterSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LWWRegisterSpec.scala @@ -7,10 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class LWWRegisterSpec extends WordSpec with Matchers { +class LWWRegisterSpec extends AnyWordSpec with Matchers { import LWWRegister.defaultClock val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala index df126ceab9..a1daaee9f0 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/LocalConcurrencySpec.scala @@ -12,8 +12,8 @@ import akka.testkit.ImplicitSender import akka.testkit.TestKit import com.typesafe.config.ConfigFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object LocalConcurrencySpec { @@ -39,7 +39,7 @@ object LocalConcurrencySpec { class LocalConcurrencySpec(_system: ActorSystem) extends TestKit(_system) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll with ImplicitSender { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMapSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMapSpec.scala index b7a75c729b..d1a7294953 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMapSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMapSpec.scala @@ -8,10 +8,10 @@ import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.ORSet.AddDeltaOp import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ORMapSpec extends WordSpec with Matchers { +class ORMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMultiMapSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMultiMapSpec.scala index c790d8e18d..e004071069 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMultiMapSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORMultiMapSpec.scala @@ -7,9 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ORMultiMapSpec extends WordSpec with Matchers { +class ORMultiMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORSetSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORSetSpec.scala index 267cab5db4..3e273b4bbd 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORSetSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ORSetSpec.scala @@ -9,10 +9,10 @@ import scala.collection.immutable.TreeMap import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ORSetSpec extends WordSpec with Matchers { +class ORSetSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterMapSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterMapSpec.scala index cacb386568..983ad22bae 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterMapSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterMapSpec.scala @@ -7,10 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PNCounterMapSpec extends WordSpec with Matchers { +class PNCounterMapSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterSpec.scala index e748b09469..88fee0fba1 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PNCounterSpec.scala @@ -7,10 +7,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress import akka.cluster.ddata.Replicator.Changed -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PNCounterSpec extends WordSpec with Matchers { +class PNCounterSpec extends AnyWordSpec with Matchers { val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) val node2 = UniqueAddress(node1.address.copy(port = Some(2552)), 2L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PruningStateSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PruningStateSpec.scala index 76dc2ee5c1..ceedee1077 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/PruningStateSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/PruningStateSpec.scala @@ -6,10 +6,10 @@ package akka.cluster.ddata import akka.actor.Address import akka.cluster.UniqueAddress -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PruningStateSpec extends WordSpec with Matchers { +class PruningStateSpec extends AnyWordSpec with Matchers { import PruningState._ val node1 = UniqueAddress(Address("akka", "Sys", "localhost", 2551), 1L) diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala index afca8d6416..83f311aecf 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/ReplicatorSettingsSpec.scala @@ -6,7 +6,8 @@ package akka.cluster.ddata import akka.testkit.AkkaSpec import com.typesafe.config.ConfigFactory -import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.wordspec.AnyWordSpecLike object ReplicatorSettingsSpec { @@ -17,7 +18,10 @@ object ReplicatorSettingsSpec { akka.remote.artery.canonical.hostname = 127.0.0.1""") } -class ReplicatorSettingsSpec extends AkkaSpec(ReplicatorSettingsSpec.config) with WordSpecLike with BeforeAndAfterAll { +class ReplicatorSettingsSpec + extends AkkaSpec(ReplicatorSettingsSpec.config) + with AnyWordSpecLike + with BeforeAndAfterAll { "DistributedData" must { "have the default replicator name" in { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/VersionVectorSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/VersionVectorSpec.scala index 636524939f..9f236d7eaa 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/VersionVectorSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/VersionVectorSpec.scala @@ -9,12 +9,12 @@ import akka.actor.Address import akka.cluster.UniqueAddress import akka.testkit.TestKit import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class VersionVectorSpec extends TestKit(ActorSystem("VersionVectorSpec")) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala index 356fece8bc..761a3807c4 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatedDataSerializerSpec.scala @@ -9,8 +9,8 @@ import java.util.Base64 import akka.actor.ActorIdentity import akka.actor.ActorRef import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import akka.actor.ActorSystem import akka.actor.Address import akka.actor.ExtendedActorSystem @@ -36,7 +36,7 @@ class ReplicatedDataSerializerSpec akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port = 0 """))) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala index 33e78dab23..c59f914373 100644 --- a/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala +++ b/akka-distributed-data/src/test/scala/akka/cluster/ddata/protobuf/ReplicatorMessageSerializerSpec.scala @@ -4,12 +4,10 @@ package akka.cluster.ddata.protobuf -import java.lang.IllegalArgumentException - import scala.concurrent.duration._ import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import akka.actor.ActorSystem import akka.actor.Address import akka.actor.ExtendedActorSystem @@ -40,7 +38,7 @@ class ReplicatorMessageSerializerSpec akka.remote.classic.netty.tcp.port=0 akka.remote.artery.canonical.port = 0 """))) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/akka-docs/src/test/java/jdocs/AbstractJavaTest.java b/akka-docs/src/test/java/jdocs/AbstractJavaTest.java index 509bec3510..3d2d4bba8b 100644 --- a/akka-docs/src/test/java/jdocs/AbstractJavaTest.java +++ b/akka-docs/src/test/java/jdocs/AbstractJavaTest.java @@ -4,7 +4,7 @@ package jdocs; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; /** Base class for all runnable example tests written in Java */ public abstract class AbstractJavaTest extends JUnitSuite {} diff --git a/akka-docs/src/test/java/jdocs/persistence/LambdaPersistencePluginDocTest.java b/akka-docs/src/test/java/jdocs/persistence/LambdaPersistencePluginDocTest.java index ec365cada1..e7c4fe8306 100644 --- a/akka-docs/src/test/java/jdocs/persistence/LambdaPersistencePluginDocTest.java +++ b/akka-docs/src/test/java/jdocs/persistence/LambdaPersistencePluginDocTest.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; import org.junit.runner.RunWith; -import org.scalatest.junit.JUnitRunner; +import org.scalatestplus.junit.JUnitRunner; import scala.concurrent.Future; import java.util.function.Consumer; import org.iq80.leveldb.util.FileUtils; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_1/ActorHierarchyExperiments.java b/akka-docs/src/test/java/jdocs/typed/tutorial_1/ActorHierarchyExperiments.java index ebfb700adc..3ca50d9a21 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_1/ActorHierarchyExperiments.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_1/ActorHierarchyExperiments.java @@ -8,7 +8,7 @@ import akka.actor.typed.PreRestart; import akka.actor.typed.SupervisorStrategy; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import akka.actor.testkit.typed.javadsl.TestKitJunitResource; import akka.actor.typed.PostStop; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java index 6446cf8052..2f9d6934c0 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; public class DeviceTest { //#device-read-test */ -public class DeviceTest extends org.scalatest.junit.JUnitSuite { +public class DeviceTest extends org.scalatestplus.junit.JUnitSuite { // #device-read-test @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java index a987c83301..50005ad8a6 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java index 34bb558bae..c9a5eb414b 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static org.junit.Assert.assertNotEquals; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java index 100fa3f6bd..9e5c64adbf 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.Optional; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java index 88484b2fff..a55c07d285 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; import java.util.HashMap; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java index 042f353014..282bf2e0bb 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.HashMap; import java.util.Map; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java index 5c30e05ca5..a4d49bbfe5 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static org.junit.Assert.assertNotEquals; diff --git a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java index 26221d7979..7d86540f35 100644 --- a/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java +++ b/akka-docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java @@ -9,7 +9,7 @@ import akka.actor.testkit.typed.javadsl.TestProbe; import akka.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.Optional; diff --git a/akka-docs/src/test/scala/docs/dispatcher/DispatcherDocSpec.scala b/akka-docs/src/test/scala/docs/dispatcher/DispatcherDocSpec.scala index 547fb8ad10..eed93e61e2 100644 --- a/akka-docs/src/test/scala/docs/dispatcher/DispatcherDocSpec.scala +++ b/akka-docs/src/test/scala/docs/dispatcher/DispatcherDocSpec.scala @@ -6,14 +6,10 @@ package docs.dispatcher import language.postfixOps -import org.scalatest.{ BeforeAndAfterAll, WordSpec } -import org.scalatest.Matchers import akka.testkit.AkkaSpec import akka.event.Logging import akka.event.LoggingAdapter import akka.actor._ -import docs.dispatcher.DispatcherDocSpec.MyBoundedActor -import akka.dispatch.RequiresMessageQueue object DispatcherDocSpec { val javaConfig = """ diff --git a/akka-osgi/src/test/scala/akka/osgi/ActorSystemActivatorTest.scala b/akka-osgi/src/test/scala/akka/osgi/ActorSystemActivatorTest.scala index 5d077307af..2bccfb466f 100644 --- a/akka-osgi/src/test/scala/akka/osgi/ActorSystemActivatorTest.scala +++ b/akka-osgi/src/test/scala/akka/osgi/ActorSystemActivatorTest.scala @@ -6,7 +6,6 @@ package akka.osgi import language.postfixOps -import org.scalatest.WordSpec import akka.actor.ActorSystem import akka.pattern.ask import scala.concurrent.Await @@ -17,7 +16,8 @@ import de.kalpatec.pojosr.framework.launch.BundleDescriptor import test.{ PingPongActorSystemActivator, RuntimeNameActorSystemActivator, TestActivators } import test.PingPong._ import PojoSRTestSupport.bundle -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec /** * Test cases for [[akka.osgi.ActorSystemActivator]] in 2 different scenarios: @@ -30,7 +30,7 @@ object ActorSystemActivatorTest { } -class PingPongActorSystemActivatorTest extends WordSpec with Matchers with PojoSRTestSupport { +class PingPongActorSystemActivatorTest extends AnyWordSpec with Matchers with PojoSRTestSupport { import ActorSystemActivatorTest._ @@ -63,7 +63,7 @@ class PingPongActorSystemActivatorTest extends WordSpec with Matchers with PojoS } -class RuntimeNameActorSystemActivatorTest extends WordSpec with Matchers with PojoSRTestSupport { +class RuntimeNameActorSystemActivatorTest extends AnyWordSpec with Matchers with PojoSRTestSupport { import ActorSystemActivatorTest._ diff --git a/akka-persistence-query/src/test/scala/akka/persistence/query/OffsetSpec.scala b/akka-persistence-query/src/test/scala/akka/persistence/query/OffsetSpec.scala index 634030fc53..8178974829 100644 --- a/akka-persistence-query/src/test/scala/akka/persistence/query/OffsetSpec.scala +++ b/akka-persistence-query/src/test/scala/akka/persistence/query/OffsetSpec.scala @@ -6,11 +6,11 @@ package akka.persistence.query import java.util.UUID -import org.scalatest.{ Matchers, WordSpecLike } - import scala.util.Random +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class OffsetSpec extends WordSpecLike with Matchers { +class OffsetSpec extends AnyWordSpecLike with Matchers { "TimeBasedUUID offset" must { diff --git a/akka-persistence-query/src/test/scala/akka/persistence/query/PersistenceQuerySpec.scala b/akka-persistence-query/src/test/scala/akka/persistence/query/PersistenceQuerySpec.scala index 8a4c502611..c4b89db255 100644 --- a/akka-persistence-query/src/test/scala/akka/persistence/query/PersistenceQuerySpec.scala +++ b/akka-persistence-query/src/test/scala/akka/persistence/query/PersistenceQuerySpec.scala @@ -9,12 +9,14 @@ import java.util.concurrent.atomic.AtomicInteger import akka.actor.ActorSystem import akka.persistence.journal.{ EventSeq, ReadEventAdapter } import com.typesafe.config.{ Config, ConfigFactory } -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import scala.concurrent.Await import scala.concurrent.duration._ -class PersistenceQuerySpec extends WordSpecLike with Matchers with BeforeAndAfterAll { +class PersistenceQuerySpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { val eventAdaptersConfig = s""" diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/PluginSpec.scala b/akka-persistence-tck/src/main/scala/akka/persistence/PluginSpec.scala index 032f07ac9c..674f73c10e 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/PluginSpec.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/PluginSpec.scala @@ -11,10 +11,12 @@ import akka.testkit._ import com.typesafe.config._ import org.scalatest._ import java.util.UUID +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike abstract class PluginSpec(val config: Config) extends TestKitBase - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfterEach { diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/scalatest/MayVerb.scala b/akka-persistence-tck/src/main/scala/akka/persistence/scalatest/MayVerb.scala index 2d3c4ed1c7..427e0d8a5d 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/scalatest/MayVerb.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/scalatest/MayVerb.scala @@ -6,7 +6,7 @@ package akka.persistence.scalatest import org.scalactic.source.Position import org.scalatest.exceptions.TestCanceledException -import org.scalatest.words.StringVerbBlockRegistration +import org.scalatest.verbs.StringVerbBlockRegistration trait MayVerb { import MayVerb._ diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java index 5f729562ce..8f4fb8bb2b 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/EventSourcedActorFailureTest.java @@ -19,7 +19,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.time.Duration; diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java index a61bf640a3..e6c2d4b8e7 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/LoggerSourceTest.java @@ -19,7 +19,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.HashMap; import java.util.Map; diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/NullEmptyStateTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/NullEmptyStateTest.java index 99d9875d4d..98603fb170 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/NullEmptyStateTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/NullEmptyStateTest.java @@ -17,7 +17,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class NullEmptyStateTest extends JUnitSuite { diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java index 1613e37b7c..45a57a3df4 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PersistentActorJavaDslTest.java @@ -33,7 +33,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import org.slf4j.event.Level; import java.time.Duration; diff --git a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PrimitiveStateTest.java b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PrimitiveStateTest.java index 4e2dc3ca5f..550c581937 100644 --- a/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PrimitiveStateTest.java +++ b/akka-persistence-typed/src/test/java/akka/persistence/typed/javadsl/PrimitiveStateTest.java @@ -17,7 +17,7 @@ import com.typesafe.config.ConfigFactory; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public class PrimitiveStateTest extends JUnitSuite { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala index 6a8a44f3e9..e343fa64ca 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/ManyRecoveriesSpec.scala @@ -15,7 +15,7 @@ import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ManyRecoveriesSpec { @@ -58,7 +58,7 @@ class ManyRecoveriesSpec extends ScalaTestWithActorTestKit(s""" } akka.persistence.max-concurrent-recoveries = 3 akka.persistence.journal.plugin = "akka.persistence.journal.inmem" - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { import ManyRecoveriesSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/PersistenceIdSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/PersistenceIdSpec.scala index 166f26aa20..26673fd55d 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/PersistenceIdSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/PersistenceIdSpec.scala @@ -5,10 +5,10 @@ package akka.persistence.typed import akka.actor.testkit.typed.scaladsl.LogCapturing -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class PersistenceIdSpec extends WordSpec with Matchers with LogCapturing { +class PersistenceIdSpec extends AnyWordSpec with Matchers with LogCapturing { "PersistenceId" must { "use | as default entityIdSeparator for compatibility with Lagom's scaladsl" in { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/StashingWhenSnapshottingSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/StashingWhenSnapshottingSpec.scala index c79dac6984..ec44854444 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/StashingWhenSnapshottingSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/StashingWhenSnapshottingSpec.scala @@ -19,12 +19,12 @@ import akka.actor.typed.scaladsl.adapter._ import akka.persistence.typed.StashingWhenSnapshottingSpec.ControllableSnapshotStoreExt import akka.persistence.typed.scaladsl.Effect import akka.persistence.typed.scaladsl.EventSourcedBehavior -import org.scalatest.WordSpecLike import scala.concurrent.Future import scala.concurrent.Promise import scala.util.Success import akka.actor.testkit.typed.scaladsl.LogCapturing +import org.scalatest.wordspec.AnyWordSpecLike object StashingWhenSnapshottingSpec { object ControllableSnapshotStoreExt extends ExtensionId[ControllableSnapshotStoreExt] { @@ -86,7 +86,7 @@ object StashingWhenSnapshottingSpec { class StashingWhenSnapshottingSpec extends ScalaTestWithActorTestKit(StashingWhenSnapshottingSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { "A persistent actor" should { "stash messages and automatically replay when snapshot is in progress" in { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala index f81d65389e..afa7624024 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RecoveryPermitterSpec.scala @@ -21,7 +21,7 @@ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object RecoveryPermitterSpec { @@ -72,7 +72,7 @@ class RecoveryPermitterSpec extends ScalaTestWithActorTestKit(s""" akka.persistence.journal.plugin = "akka.persistence.journal.inmem" akka.persistence.journal.inmem.test-serialization = on akka.loggers = ["akka.testkit.TestEventListener"] - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { import RecoveryPermitterSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RetentionCriteriaSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RetentionCriteriaSpec.scala index b4f1068af1..81dca58b1e 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RetentionCriteriaSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/RetentionCriteriaSpec.scala @@ -6,11 +6,11 @@ package akka.persistence.typed.internal import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.persistence.typed.scaladsl.RetentionCriteria -import org.scalatest.Matchers import org.scalatest.TestSuite -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class RetentionCriteriaSpec extends TestSuite with Matchers with WordSpecLike with LogCapturing { +class RetentionCriteriaSpec extends TestSuite with Matchers with AnyWordSpecLike with LogCapturing { "RetentionCriteria" must { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/StashStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/StashStateSpec.scala index 6f6f8be6dc..40bd752dfa 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/StashStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/internal/StashStateSpec.scala @@ -13,9 +13,9 @@ import akka.actor.typed.Behavior import akka.actor.typed.scaladsl.Behaviors import akka.persistence.typed.internal.InternalProtocol.IncomingCommand import akka.persistence.typed.internal.InternalProtocol.RecoveryPermitGranted -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike -class StashStateSpec extends ScalaTestWithActorTestKit with WordSpecLike with LogCapturing { +class StashStateSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with LogCapturing { "StashState" should { diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala index bc25d63286..a5732632f6 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorFailureSpec.scala @@ -29,7 +29,7 @@ import akka.persistence.typed.RecoveryFailed import akka.persistence.typed.internal.JournalFailureException import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike class ChaosJournal extends InmemJournal { var counts = Map.empty[String, Int] @@ -82,7 +82,7 @@ object EventSourcedBehaviorFailureSpec { class EventSourcedBehaviorFailureSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorFailureSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { implicit val testSettings: TestKitSettings = TestKitSettings(system) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala index 41a25485bb..7a3a330d30 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorInterceptorSpec.scala @@ -15,7 +15,7 @@ import akka.actor.typed.scaladsl.Behaviors import akka.persistence.typed.PersistenceId import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorInterceptorSpec { @@ -44,7 +44,7 @@ object EventSourcedBehaviorInterceptorSpec { class EventSourcedBehaviorInterceptorSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorTimersSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorInterceptorSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala index e51c31d531..c7b37b79c8 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRecoveryTimeoutSpec.scala @@ -19,7 +19,7 @@ import akka.persistence.typed.RecoveryFailed import akka.persistence.typed.internal.JournalFailureException import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorRecoveryTimeoutSpec { @@ -51,7 +51,7 @@ object EventSourcedBehaviorRecoveryTimeoutSpec { class EventSourcedBehaviorRecoveryTimeoutSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorRecoveryTimeoutSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorRecoveryTimeoutSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala index 189d5e0113..ac65750a10 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorReplySpec.scala @@ -17,7 +17,7 @@ import akka.persistence.typed.PersistenceId import akka.serialization.jackson.CborSerializable import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorReplySpec { def conf: Config = ConfigFactory.parseString(s""" @@ -75,7 +75,7 @@ object EventSourcedBehaviorReplySpec { class EventSourcedBehaviorReplySpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorReplySpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorReplySpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala index f347ce0d8e..b0ada72fc7 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorRetentionSpec.scala @@ -28,9 +28,9 @@ import akka.serialization.jackson.CborSerializable import akka.util.unused import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.Matchers -import org.scalatest.WordSpecLike import scala.concurrent.duration._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorRetentionSpec extends Matchers { @@ -126,7 +126,7 @@ object EventSourcedBehaviorRetentionSpec extends Matchers { class EventSourcedBehaviorRetentionSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorRetentionSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorRetentionSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala index 136e0d3709..75ba1ce3c0 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorSpec.scala @@ -43,7 +43,7 @@ import akka.serialization.jackson.CborSerializable import akka.stream.scaladsl.Sink import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorSpec { @@ -279,7 +279,7 @@ object EventSourcedBehaviorSpec { class EventSourcedBehaviorSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala index 4df7d3cb40..eab7f98fa6 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorStashSpec.scala @@ -28,7 +28,7 @@ import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorStashSpec { def conf: Config = ConfigFactory.parseString(s""" @@ -165,7 +165,7 @@ object EventSourcedBehaviorStashSpec { class EventSourcedBehaviorStashSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorStashSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorStashSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala index 85001a772e..e012ea1383 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorTimersSpec.scala @@ -16,7 +16,7 @@ import akka.actor.typed.scaladsl.Behaviors import akka.persistence.typed.PersistenceId import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorTimersSpec { @@ -74,7 +74,7 @@ object EventSourcedBehaviorTimersSpec { class EventSourcedBehaviorTimersSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorTimersSpec.config) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorTimersSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala index 958e007352..b2afca57ba 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedBehaviorWatchSpec.scala @@ -22,7 +22,7 @@ import akka.persistence.typed.internal.EventSourcedBehaviorImpl.WriterIdentity import akka.persistence.typed.{ NoOpEventAdapter, PersistenceId, RecoveryCompleted } import akka.serialization.jackson.CborSerializable import akka.util.ConstantFun -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedBehaviorWatchSpec { sealed trait Command extends CborSerializable @@ -34,7 +34,7 @@ object EventSourcedBehaviorWatchSpec { class EventSourcedBehaviorWatchSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedBehaviorWatchSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala index 7bfc8463aa..3e7f79e6b8 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedEventAdapterSpec.scala @@ -23,7 +23,7 @@ import akka.serialization.jackson.CborSerializable import akka.stream.scaladsl.Sink import akka.testkit.JavaSerializable import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedEventAdapterSpec { @@ -82,7 +82,7 @@ object EventSourcedEventAdapterSpec { class EventSourcedEventAdapterSpec extends ScalaTestWithActorTestKit(EventSourcedEventAdapterSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedEventAdapterSpec._ import EventSourcedBehaviorSpec.{ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala index 103ae1d26a..768e8febe4 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSequenceNumberSpec.scala @@ -11,7 +11,7 @@ import akka.actor.typed.scaladsl.Behaviors import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedSequenceNumberSpec { @@ -26,7 +26,7 @@ object EventSourcedSequenceNumberSpec { class EventSourcedSequenceNumberSpec extends ScalaTestWithActorTestKit(EventSourcedSequenceNumberSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { private def behavior(pid: PersistenceId, probe: ActorRef[String]): Behavior[String] = diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala index 2d94ab8360..31bbc7a8ca 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/EventSourcedSnapshotAdapterSpec.scala @@ -18,7 +18,7 @@ import akka.persistence.typed.SnapshotAdapter import akka.serialization.jackson.CborSerializable import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object EventSourcedSnapshotAdapterSpec { private val conf: Config = ConfigFactory.parseString(s""" @@ -35,7 +35,7 @@ object EventSourcedSnapshotAdapterSpec { class EventSourcedSnapshotAdapterSpec extends ScalaTestWithActorTestKit(EventSourcedSnapshotAdapterSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import EventSourcedSnapshotAdapterSpec._ import akka.actor.typed.scaladsl.adapter._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala index b1ce560627..296bb42bf8 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/LoggerSourceSpec.scala @@ -14,14 +14,14 @@ import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import akka.persistence.typed.SnapshotCompleted import akka.persistence.typed.SnapshotFailed -import org.scalatest.WordSpecLike import org.slf4j.event.Level +import org.scalatest.wordspec.AnyWordSpecLike // Note that the spec name here is important since there are heuristics in place to avoid names // starting with EventSourcedBehavior class LoggerSourceSpec extends ScalaTestWithActorTestKit(EventSourcedBehaviorSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { private val pidCounter = new AtomicInteger(0) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala index 471728ccc7..b98de12bbc 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/NullEmptyStateSpec.scala @@ -11,7 +11,7 @@ import akka.actor.typed.Behavior import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object NullEmptyStateSpec { @@ -23,7 +23,7 @@ object NullEmptyStateSpec { class NullEmptyStateSpec extends ScalaTestWithActorTestKit(NullEmptyStateSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { implicit val testSettings = TestKitSettings(system) diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala index 93959fb324..856d2945fb 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/OptionalSnapshotStoreSpec.scala @@ -13,7 +13,7 @@ import akka.actor.testkit.typed.scaladsl.LogCapturing import akka.persistence.typed.PersistenceId import akka.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler import akka.serialization.jackson.CborSerializable -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object OptionalSnapshotStoreSpec { @@ -48,7 +48,7 @@ class OptionalSnapshotStoreSpec extends ScalaTestWithActorTestKit(s""" # snapshot store plugin is NOT defined, things should still work akka.persistence.snapshot-store.local.dir = "target/snapshots-${classOf[OptionalSnapshotStoreSpec].getName}/" - """) with WordSpecLike with LogCapturing { + """) with AnyWordSpecLike with LogCapturing { import OptionalSnapshotStoreSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala index d6813759bf..c86123a3a1 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PerformanceSpec.scala @@ -19,7 +19,7 @@ import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import akka.persistence.typed.scaladsl.EventSourcedBehavior.CommandHandler import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object PerformanceSpec { @@ -117,7 +117,7 @@ class PerformanceSpec extends ScalaTestWithActorTestKit(ConfigFactory.parseStrin akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local" akka.persistence.snapshot-store.local.dir = "target/snapshots-PerformanceSpec/" akka.test.single-expect-default = 10s - """).withFallback(ConfigFactory.parseString(PerformanceSpec.config))) with WordSpecLike with LogCapturing { + """).withFallback(ConfigFactory.parseString(PerformanceSpec.config))) with AnyWordSpecLike with LogCapturing { import PerformanceSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala index 66245a029e..073810d06e 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/PrimitiveStateSpec.scala @@ -10,7 +10,7 @@ import akka.actor.typed.Behavior import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object PrimitiveStateSpec { @@ -22,7 +22,7 @@ object PrimitiveStateSpec { class PrimitiveStateSpec extends ScalaTestWithActorTestKit(PrimitiveStateSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { def primitiveState(persistenceId: PersistenceId, probe: ActorRef[String]): Behavior[Int] = diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala index 462b72c270..15a3ad6aa2 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotMutableStateSpec.scala @@ -16,7 +16,7 @@ import akka.persistence.typed.SnapshotFailed import akka.serialization.jackson.CborSerializable import com.typesafe.config.Config import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object SnapshotMutableStateSpec { @@ -71,7 +71,7 @@ object SnapshotMutableStateSpec { class SnapshotMutableStateSpec extends ScalaTestWithActorTestKit(SnapshotMutableStateSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import SnapshotMutableStateSpec._ diff --git a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala index 89c3f48595..68deea04c3 100644 --- a/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala +++ b/akka-persistence-typed/src/test/scala/akka/persistence/typed/scaladsl/SnapshotRecoveryWithEmptyJournalSpec.scala @@ -19,7 +19,7 @@ import akka.serialization.SerializationExtension import com.typesafe.config.Config import com.typesafe.config.ConfigFactory import org.apache.commons.io.FileUtils -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object SnapshotRecoveryWithEmptyJournalSpec { val survivingSnapshotPath = s"target/survivingSnapshotPath-${UUID.randomUUID().toString}" @@ -57,7 +57,7 @@ object SnapshotRecoveryWithEmptyJournalSpec { class SnapshotRecoveryWithEmptyJournalSpec extends ScalaTestWithActorTestKit(SnapshotRecoveryWithEmptyJournalSpec.conf) - with WordSpecLike + with AnyWordSpecLike with LogCapturing { import SnapshotRecoveryWithEmptyJournalSpec._ diff --git a/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala b/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala index 214ee46751..80d27b7ede 100644 --- a/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala +++ b/akka-persistence-typed/src/test/scala/docs/akka/persistence/typed/PersistentFsmToTypedMigrationSpec.scala @@ -30,10 +30,9 @@ import akka.persistence.typed.PersistenceId import akka.persistence.typed.RecoveryCompleted import akka.persistence.typed.SnapshotAdapter import com.typesafe.config.ConfigFactory -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec import org.scalatest.concurrent.ScalaFutures import scala.concurrent.duration._ - import akka.actor.testkit.typed.scaladsl.LogCapturing object PersistentFsmToTypedMigrationSpec { @@ -206,7 +205,7 @@ object ShoppingCartBehavior { } -class PersistentFsmToTypedMigrationSpec extends WordSpec with ScalaFutures with LogCapturing { +class PersistentFsmToTypedMigrationSpec extends AnyWordSpec with ScalaFutures with LogCapturing { import akka.persistence.fsm.PersistentFSMSpec._ diff --git a/akka-persistence/src/test/java/akka/persistence/fsm/AbstractPersistentFSMTest.java b/akka-persistence/src/test/java/akka/persistence/fsm/AbstractPersistentFSMTest.java index 1eade8c179..751492ac2c 100644 --- a/akka-persistence/src/test/java/akka/persistence/fsm/AbstractPersistentFSMTest.java +++ b/akka-persistence/src/test/java/akka/persistence/fsm/AbstractPersistentFSMTest.java @@ -21,7 +21,7 @@ import java.time.Duration; import akka.persistence.fsm.PersistentFSM.CurrentState; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import static akka.persistence.fsm.PersistentFSM.FSMState; diff --git a/akka-persistence/src/test/scala/akka/persistence/AtomicWriteSpec.scala b/akka-persistence/src/test/scala/akka/persistence/AtomicWriteSpec.scala index ecced72c29..f080cb2494 100644 --- a/akka-persistence/src/test/scala/akka/persistence/AtomicWriteSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/AtomicWriteSpec.scala @@ -4,9 +4,10 @@ package akka.persistence -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class AtomicWriteSpec extends WordSpec with Matchers { +class AtomicWriteSpec extends AnyWordSpec with Matchers { "AtomicWrite" must { "only contain messages for the same persistence id" in { diff --git a/akka-persistence/src/test/scala/akka/persistence/EndToEndEventAdapterSpec.scala b/akka-persistence/src/test/scala/akka/persistence/EndToEndEventAdapterSpec.scala index 7321523d6a..34a9136814 100644 --- a/akka-persistence/src/test/scala/akka/persistence/EndToEndEventAdapterSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/EndToEndEventAdapterSpec.scala @@ -7,13 +7,14 @@ package akka.persistence import java.io.File import akka.actor._ -import akka.persistence.EndToEndEventAdapterSpec.NewA import akka.persistence.journal.{ EventAdapter, EventSeq } import akka.testkit.{ EventFilter, TestProbe } import akka.util.unused import com.typesafe.config.{ Config, ConfigFactory } import org.apache.commons.io.FileUtils -import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import scala.concurrent.Await import scala.concurrent.duration._ @@ -96,7 +97,7 @@ object EndToEndEventAdapterSpec { } abstract class EndToEndEventAdapterSpec(journalName: String, journalConfig: Config) - extends WordSpecLike + extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { import EndToEndEventAdapterSpec._ diff --git a/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/CompactionSegmentManagementSpec.scala b/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/CompactionSegmentManagementSpec.scala index 343ec54c47..8e82097470 100644 --- a/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/CompactionSegmentManagementSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/journal/leveldb/CompactionSegmentManagementSpec.scala @@ -4,9 +4,9 @@ package akka.persistence.journal.leveldb -import org.scalatest.WordSpec +import org.scalatest.wordspec.AnyWordSpec -class CompactionSegmentManagementSpec extends WordSpec { +class CompactionSegmentManagementSpec extends AnyWordSpec { "A CompactionSegmentManagement compatible object" must { "ignore persistence ids without declared compaction intervals" in { diff --git a/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala index 3cdce51059..cfc68bc6c4 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/artery/ArteryFailedToBindSpec.scala @@ -10,9 +10,10 @@ import akka.remote.RemoteTransportException import akka.testkit.SocketUtil import akka.testkit.TestKit import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ArteryFailedToBindSpec extends WordSpec with Matchers { +class ArteryFailedToBindSpec extends AnyWordSpec with Matchers { "an ActorSystem" must { "not start if port is taken" in { diff --git a/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala index 3de3e5198f..a1c4de0276 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/classic/RemotingFailedToBindSpec.scala @@ -8,9 +8,10 @@ import akka.actor.ActorSystem import akka.testkit.SocketUtil import com.typesafe.config.ConfigFactory import org.jboss.netty.channel.ChannelException -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class RemotingFailedToBindSpec extends WordSpec with Matchers { +class RemotingFailedToBindSpec extends AnyWordSpec with Matchers { "an ActorSystem" must { "not start if port is taken" in { diff --git a/akka-remote-tests/src/test/scala/akka/remote/testkit/STMultiNodeSpec.scala b/akka-remote-tests/src/test/scala/akka/remote/testkit/STMultiNodeSpec.scala index a1b7358eb1..476d6c27f0 100644 --- a/akka-remote-tests/src/test/scala/akka/remote/testkit/STMultiNodeSpec.scala +++ b/akka-remote-tests/src/test/scala/akka/remote/testkit/STMultiNodeSpec.scala @@ -7,13 +7,14 @@ package akka.remote.testkit import scala.language.implicitConversions -import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } -import org.scalatest.Matchers +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike /** * Hooks up MultiNodeSpec with ScalaTest */ -trait STMultiNodeSpec extends MultiNodeSpecCallbacks with WordSpecLike with Matchers with BeforeAndAfterAll { +trait STMultiNodeSpec extends MultiNodeSpecCallbacks with AnyWordSpecLike with Matchers with BeforeAndAfterAll { self: MultiNodeSpec => override def beforeAll() = multiNodeSpecBeforeAll() diff --git a/akka-remote-tests/src/test/scala/org/scalatest/extra/QuietReporter.scala b/akka-remote-tests/src/test/scala/org/scalatest/extra/QuietReporter.scala index 68629f88c0..d44004d138 100644 --- a/akka-remote-tests/src/test/scala/org/scalatest/extra/QuietReporter.scala +++ b/akka-remote-tests/src/test/scala/org/scalatest/extra/QuietReporter.scala @@ -9,7 +9,7 @@ import org.scalatest.events._ import java.lang.Boolean.getBoolean class QuietReporter(inColor: Boolean, withDurations: Boolean = false) - extends StandardOutReporter(withDurations, inColor, false, true, false, false, false, false, false, false) { + extends StandardOutReporter(withDurations, inColor, false, true, false, false, false, false, false, false, false) { def this() = this(!getBoolean("akka.test.nocolor"), !getBoolean("akka.test.nodurations")) diff --git a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala index bb28ce3dec..5529e8576d 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/BindCanonicalAddressSpec.scala @@ -9,15 +9,15 @@ import akka.actor.{ ActorSystem, Address } import akka.remote.classic.transport.netty.NettyTransportSpec._ import scala.concurrent.Await -import org.scalatest.WordSpec -import org.scalatest.Matchers import scala.concurrent.duration.Duration import akka.testkit.SocketUtil import java.net.InetAddress +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec trait BindCanonicalAddressBehaviors { - this: WordSpec with Matchers => + this: AnyWordSpec with Matchers => def arteryConnectionTest(transport: String, isUDP: Boolean): Unit = { val commonConfig = BindCanonicalAddressSpec.commonConfig(transport) @@ -100,7 +100,7 @@ trait BindCanonicalAddressBehaviors { } } -class BindCanonicalAddressSpec extends WordSpec with Matchers with BindCanonicalAddressBehaviors { +class BindCanonicalAddressSpec extends AnyWordSpec with Matchers with BindCanonicalAddressBehaviors { s"artery with aeron-udp transport" should { behave.like(arteryConnectionTest("aeron-udp", isUDP = true)) } diff --git a/akka-remote/src/test/scala/akka/remote/artery/ImmutableLongMapSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/ImmutableLongMapSpec.scala index 065ca61b8d..2bf65cffe2 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/ImmutableLongMapSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/ImmutableLongMapSpec.scala @@ -4,12 +4,12 @@ package akka.remote.artery -import org.scalatest.Matchers -import org.scalatest.WordSpec import akka.util.OptionVal import scala.util.Random +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ImmutableLongMapSpec extends WordSpec with Matchers { +class ImmutableLongMapSpec extends AnyWordSpec with Matchers { "ImmutableLongMap" must { diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemoteInstrumentsSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemoteInstrumentsSpec.scala index 3c86eea743..f76145b9eb 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemoteInstrumentsSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemoteInstrumentsSpec.scala @@ -6,9 +6,10 @@ package akka.remote.artery import org.scalacheck.{ Arbitrary, Gen } import org.scalatestplus.scalacheck.Checkers -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class RemoteInstrumentsSpec extends WordSpec with Matchers with Checkers { +class RemoteInstrumentsSpec extends AnyWordSpec with Matchers with Checkers { case class KeyLen(k: Key, l: Len) { override def toString = s" key = ${k}, len = ${l}" diff --git a/akka-remote/src/test/scala/akka/remote/artery/RemotingFlightRecorderSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RemotingFlightRecorderSpec.scala index 6a71fee78d..5a769db8d1 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RemotingFlightRecorderSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RemotingFlightRecorderSpec.scala @@ -6,7 +6,7 @@ package akka.remote.artery import akka.testkit.AkkaSpec import akka.util.JavaVersion -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers class RemotingFlightRecorderSpec extends AkkaSpec with Matchers { diff --git a/akka-remote/src/test/scala/akka/remote/artery/RestartCounterSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/RestartCounterSpec.scala index cd604bddd2..6f1fd5c2c3 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/RestartCounterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/RestartCounterSpec.scala @@ -6,10 +6,10 @@ package akka.remote.artery import scala.concurrent.duration._ -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class RestartCounterSpec extends WordSpec with Matchers { +class RestartCounterSpec extends AnyWordSpec with Matchers { "RestartCounter" must { diff --git a/akka-remote/src/test/scala/akka/remote/artery/compress/HeavyHittersSpec.scala b/akka-remote/src/test/scala/akka/remote/artery/compress/HeavyHittersSpec.scala index c46a3588f9..2ea9aec76d 100644 --- a/akka-remote/src/test/scala/akka/remote/artery/compress/HeavyHittersSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/artery/compress/HeavyHittersSpec.scala @@ -4,9 +4,10 @@ package akka.remote.artery.compress -import org.scalatest.{ Matchers, WordSpecLike } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike -class HeavyHittersSpec extends WordSpecLike with Matchers { +class HeavyHittersSpec extends AnyWordSpecLike with Matchers { "TopHeavyHitters" must { "should work" in { diff --git a/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala index f9e253181f..0a778fcf7e 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteInitErrorSpec.scala @@ -7,20 +7,21 @@ package akka.remote.classic import akka.actor.ActorSystem import com.typesafe.config.ConfigFactory import org.scalatest.concurrent.Eventually._ -import org.scalatest.{ Matchers, WordSpec } import akka.util.ccompat.JavaConverters._ import scala.collection.mutable.Set import scala.concurrent.duration._ import scala.language.postfixOps import scala.util.control.NonFatal +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec /** * The 192.0.2.1 is a Documentation IP-address and should not be used at all * by any network node. Therefore we assume here that the initialization of * the ActorSystem with the use of remoting will intentionally fail. */ -class RemoteInitErrorSpec extends WordSpec with Matchers { +class RemoteInitErrorSpec extends AnyWordSpec with Matchers { val conf = ConfigFactory.parseString(""" akka { actor { diff --git a/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala index 9d6135e7f5..1dd61e12eb 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/RemoteSettingsSpec.scala @@ -7,10 +7,11 @@ package akka.remote.classic import akka.remote.RemoteSettings import com.github.ghik.silencer.silent import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec @silent("deprecated") -class RemoteSettingsSpec extends WordSpec with Matchers { +class RemoteSettingsSpec extends AnyWordSpec with Matchers { "Remote settings" must { "default akka.remote.classic.log-frame-size-exceeding to off" in { diff --git a/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala index 53b3bff2d1..922c201af2 100644 --- a/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/classic/transport/netty/NettyTransportSpec.scala @@ -11,10 +11,11 @@ import akka.actor.{ ActorSystem, Address, ExtendedActorSystem } import akka.remote.BoundAddressesExtension import akka.testkit.SocketUtil import com.typesafe.config.ConfigFactory -import org.scalatest.{ Matchers, WordSpec } import scala.concurrent.Await import scala.concurrent.duration.Duration +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object NettyTransportSpec { val commonConfig = ConfigFactory.parseString(""" @@ -38,7 +39,7 @@ object NettyTransportSpec { } } -class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { +class NettyTransportSpec extends AnyWordSpec with Matchers with BindBehavior { import NettyTransportSpec._ "NettyTransport" should { @@ -124,7 +125,7 @@ class NettyTransportSpec extends WordSpec with Matchers with BindBehavior { } trait BindBehavior { - this: WordSpec with Matchers => + this: AnyWordSpec with Matchers => import NettyTransportSpec._ diff --git a/akka-serialization-jackson/src/test/scala/akka/serialization/jackson/JacksonSerializerSpec.scala b/akka-serialization-jackson/src/test/scala/akka/serialization/jackson/JacksonSerializerSpec.scala index a482749178..e40da0405a 100644 --- a/akka-serialization-jackson/src/test/scala/akka/serialization/jackson/JacksonSerializerSpec.scala +++ b/akka-serialization-jackson/src/test/scala/akka/serialization/jackson/JacksonSerializerSpec.scala @@ -43,8 +43,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.typesafe.config.ConfigFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.core.StreamReadFeature @@ -563,7 +563,7 @@ abstract class JacksonSerializerSpec(serializerName: String) } akka.serialization.jackson.whitelist-class-prefix = ["akka.serialization.jackson.ScalaTestMessages$$OldCommand"] """))) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/akka-serialization-jackson/src/test/scala/doc/akka/serialization/jackson/SerializationDocSpec.scala b/akka-serialization-jackson/src/test/scala/doc/akka/serialization/jackson/SerializationDocSpec.scala index 06cfd26927..7658172725 100644 --- a/akka-serialization-jackson/src/test/scala/doc/akka/serialization/jackson/SerializationDocSpec.scala +++ b/akka-serialization-jackson/src/test/scala/doc/akka/serialization/jackson/SerializationDocSpec.scala @@ -16,8 +16,8 @@ import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo import com.typesafe.config.ConfigFactory import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike //#marker-interface /** @@ -185,7 +185,7 @@ class SerializationDocSpec } } """))) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll { diff --git a/akka-stream-testkit/src/test/scala/akka/stream/testkit/ScriptedTest.scala b/akka-stream-testkit/src/test/scala/akka/stream/testkit/ScriptedTest.scala index dd78370a1b..b241daacb7 100644 --- a/akka-stream-testkit/src/test/scala/akka/stream/testkit/ScriptedTest.scala +++ b/akka-stream-testkit/src/test/scala/akka/stream/testkit/ScriptedTest.scala @@ -17,7 +17,6 @@ import akka.stream.scaladsl.Source import akka.stream.testkit.TestPublisher._ import akka.stream.testkit.TestSubscriber._ import org.reactivestreams.Publisher -import org.scalatest.Matchers import scala.annotation.tailrec import scala.concurrent.duration._ @@ -25,6 +24,7 @@ import java.util.concurrent.ThreadLocalRandom import akka.stream.SystemMaterializer import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers trait ScriptedTest extends Matchers { diff --git a/akka-stream-tests/src/test/java/akka/stream/StreamTest.java b/akka-stream-tests/src/test/java/akka/stream/StreamTest.java index 6924d226d9..44b86931b1 100644 --- a/akka-stream-tests/src/test/java/akka/stream/StreamTest.java +++ b/akka-stream-tests/src/test/java/akka/stream/StreamTest.java @@ -6,7 +6,7 @@ package akka.stream; import akka.actor.ActorSystem; import akka.testkit.AkkaJUnitActorSystemResource; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; public abstract class StreamTest extends JUnitSuite { protected final ActorSystem system; diff --git a/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala b/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala index 4ff779a24e..2a86584d1a 100755 --- a/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala @@ -6,8 +6,8 @@ package akka.stream import java.lang.reflect.Method import java.lang.reflect.Modifier -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec object DslConsistencySpec { class ScalaSubSource[Out, Mat] @@ -22,7 +22,7 @@ object DslConsistencySpec { null) } -class DslConsistencySpec extends WordSpec with Matchers { +class DslConsistencySpec extends AnyWordSpec with Matchers { val sFlowClass: Class[_] = classOf[akka.stream.scaladsl.Flow[_, _, _]] val jFlowClass: Class[_] = classOf[akka.stream.javadsl.Flow[_, _, _]] diff --git a/akka-stream-tests/src/test/scala/akka/stream/DslFactoriesConsistencySpec.scala b/akka-stream-tests/src/test/scala/akka/stream/DslFactoriesConsistencySpec.scala index b0c99e0db1..06fc9af58f 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/DslFactoriesConsistencySpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/DslFactoriesConsistencySpec.scala @@ -4,10 +4,10 @@ package akka.stream -import org.scalatest.Matchers -import org.scalatest.WordSpec +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class DslFactoriesConsistencySpec extends WordSpec with Matchers { +class DslFactoriesConsistencySpec extends AnyWordSpec with Matchers { // configuration // diff --git a/akka-stream-tests/src/test/scala/akka/stream/impl/ResizableMultiReaderRingBufferSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/impl/ResizableMultiReaderRingBufferSpec.scala index 049669b43d..4780ec6c21 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/impl/ResizableMultiReaderRingBufferSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/impl/ResizableMultiReaderRingBufferSpec.scala @@ -5,10 +5,11 @@ package akka.stream.impl import scala.util.Random -import org.scalatest.{ Matchers, WordSpec } import akka.stream.impl.ResizableMultiReaderRingBuffer._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ResizableMultiReaderRingBufferSpec extends WordSpec with Matchers { +class ResizableMultiReaderRingBufferSpec extends AnyWordSpec with Matchers { "A ResizableMultiReaderRingBuffer" should { diff --git a/akka-stream-tests/src/test/scala/akka/stream/impl/TimeoutsSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/impl/TimeoutsSpec.scala index 2f8af006a4..1c55664039 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/impl/TimeoutsSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/impl/TimeoutsSpec.scala @@ -14,12 +14,12 @@ import akka.stream.testkit.TestPublisher import akka.stream.testkit.TestSubscriber import akka.stream.testkit.Utils._ import akka.stream.testkit.scaladsl.StreamTestKit._ -import org.scalatest.Matchers -import org.scalatest.WordSpecLike import scala.concurrent.Await import scala.concurrent.Future import scala.concurrent.duration._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class TimeoutsSpec extends StreamSpec { @@ -386,7 +386,7 @@ class TimeoutsSpec extends StreamSpec { } -class TimeoutChecksSpec extends WordSpecLike with Matchers { +class TimeoutChecksSpec extends AnyWordSpecLike with Matchers { "Timeout check interval" must { diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/compression/CodecSpecSupport.scala b/akka-stream-tests/src/test/scala/akka/stream/io/compression/CodecSpecSupport.scala index 729b7435a7..bce130c89b 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/compression/CodecSpecSupport.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/compression/CodecSpecSupport.scala @@ -8,8 +8,8 @@ import akka.actor.ActorSystem import akka.testkit.TestKit import akka.util.ByteString import org.scalatest.BeforeAndAfterAll -import org.scalatest.Matchers import org.scalatest.Suite +import org.scalatest.matchers.should.Matchers trait CodecSpecSupport extends Matchers with BeforeAndAfterAll { self: Suite => diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/compression/CoderSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/io/compression/CoderSpec.scala index ac94b06767..6c54b6ff05 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/compression/CoderSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/compression/CoderSpec.scala @@ -12,14 +12,15 @@ import akka.NotUsed import akka.stream.impl.io.compression.Compressor import akka.stream.scaladsl.{ Compression, Flow, Sink, Source } import akka.util.ByteString -import org.scalatest.{ Inspectors, WordSpec } +import org.scalatest.Inspectors +import org.scalatest.wordspec.AnyWordSpec import scala.annotation.tailrec import scala.concurrent.Await import scala.concurrent.duration._ import scala.util.control.NoStackTrace -abstract class CoderSpec(codecName: String) extends WordSpec with CodecSpecSupport with Inspectors { +abstract class CoderSpec(codecName: String) extends AnyWordSpec with CodecSpecSupport with Inspectors { import CompressionTestingTools._ protected def newCompressor(): Compressor diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowAppendSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowAppendSpec.scala index 89e2fcb3d6..d21e5f4db4 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowAppendSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowAppendSpec.scala @@ -8,7 +8,7 @@ import akka.actor.ActorSystem import akka.stream.testkit.StreamSpec import akka.stream.testkit.TestSubscriber import org.reactivestreams.Subscriber -import org.scalatest.Matchers +import org.scalatest.matchers.should.Matchers class FlowAppendSpec extends StreamSpec with River { diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala index d8fafc6c64..9f4ddd2cc9 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowScanAsyncSpec.scala @@ -10,16 +10,15 @@ import akka.stream.testkit.TestSubscriber.Probe import akka.stream.testkit.Utils.TE import akka.stream.testkit._ import akka.stream.testkit.scaladsl._ -import org.scalatest.Matchers import akka.stream.ActorAttributes import akka.stream.Supervision import scala.collection.immutable import scala.concurrent.duration._ -import scala.concurrent.{ Future, Promise } import scala.concurrent.Future import scala.concurrent.Promise import scala.util.Failure +import org.scalatest.matchers.should.Matchers class FlowScanAsyncSpec extends StreamSpec with Matchers { diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowSlidingSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowSlidingSpec.scala index e9dee2be0b..6f57edd33b 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowSlidingSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowSlidingSpec.scala @@ -8,12 +8,12 @@ import akka.stream.testkit.scaladsl.StreamTestKit._ import akka.stream.{ ActorMaterializer, ActorMaterializerSettings } import akka.stream.testkit._ import org.scalacheck.Gen -import org.scalatest.prop.GeneratorDrivenPropertyChecks import akka.pattern.pipe import com.github.ghik.silencer.silent +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks @silent -class FlowSlidingSpec extends StreamSpec with GeneratorDrivenPropertyChecks { +class FlowSlidingSpec extends StreamSpec with ScalaCheckPropertyChecks { import system.dispatcher val settings = ActorMaterializerSettings(system).withInputBuffer(initialSize = 2, maxSize = 16) @@ -22,7 +22,7 @@ class FlowSlidingSpec extends StreamSpec with GeneratorDrivenPropertyChecks { "Sliding" must { import org.scalacheck.Shrink.shrinkAny def check(gen: Gen[(Int, Int, Int)]): Unit = - forAll(gen, MinSize(1000), MaxSize(1000)) { + forAll(gen, minSize(1000), sizeRange(0)) { case (len, win, step) => val af = Source .fromIterator(() => Iterator.from(0).take(len)) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphMergeSortedSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphMergeSortedSpec.scala index e34b11def8..89504aa9fc 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphMergeSortedSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphMergeSortedSpec.scala @@ -8,11 +8,11 @@ import akka.stream._ import akka.stream.testkit.TwoStreamsSetup import com.github.ghik.silencer.silent import org.scalacheck.Gen -import org.scalatest.prop.GeneratorDrivenPropertyChecks import org.scalacheck.Shrink +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks @silent // tests deprecated apis -class GraphMergeSortedSpec extends TwoStreamsSetup with GeneratorDrivenPropertyChecks { +class GraphMergeSortedSpec extends TwoStreamsSetup with ScalaCheckPropertyChecks { override type Outputs = Int diff --git a/akka-stream-typed/src/test/java/akka/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java b/akka-stream-typed/src/test/java/akka/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java index 41021c5379..372f7cdcae 100644 --- a/akka-stream-typed/src/test/java/akka/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java +++ b/akka-stream-typed/src/test/java/akka/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java @@ -16,7 +16,7 @@ import akka.stream.javadsl.Sink; import akka.stream.javadsl.Source; import org.junit.ClassRule; import org.junit.Test; -import org.scalatest.junit.JUnitSuite; +import org.scalatestplus.junit.JUnitSuite; import java.util.concurrent.CompletionStage; import java.util.concurrent.TimeUnit; diff --git a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala index 3ba2a0ae75..11232ba4dd 100644 --- a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala +++ b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorFlowSpec.scala @@ -11,7 +11,7 @@ import akka.actor.typed.scaladsl.Behaviors import scala.concurrent.duration._ import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike //#imports import akka.stream.testkit.TestSubscriber @@ -24,7 +24,7 @@ object ActorFlowSpec { final case class Reply(s: String) } -class ActorFlowSpec extends ScalaTestWithActorTestKit with WordSpecLike { +class ActorFlowSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike { import ActorFlowSpec._ "ActorFlow" should { diff --git a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorSourceSinkSpec.scala b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorSourceSinkSpec.scala index 0eca500ccd..367c4340ea 100644 --- a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorSourceSinkSpec.scala +++ b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/ActorSourceSinkSpec.scala @@ -11,7 +11,7 @@ import akka.stream.scaladsl.Keep import akka.stream.scaladsl.Sink import akka.stream.scaladsl.Source import akka.actor.testkit.typed.scaladsl._ -import org.scalatest.WordSpecLike +import org.scalatest.wordspec.AnyWordSpecLike object ActorSourceSinkSpec { @@ -22,7 +22,7 @@ object ActorSourceSinkSpec { case object Failed extends AckProto } -class ActorSourceSinkSpec extends ScalaTestWithActorTestKit with WordSpecLike { +class ActorSourceSinkSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike { import ActorSourceSinkSpec._ "ActorSink" should { diff --git a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/MaterializerForTypedSpec.scala b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/MaterializerForTypedSpec.scala index 504a589da6..b62f2d6a9c 100644 --- a/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/MaterializerForTypedSpec.scala +++ b/akka-stream-typed/src/test/scala/akka/stream/typed/scaladsl/MaterializerForTypedSpec.scala @@ -11,12 +11,12 @@ import akka.stream.AbruptStageTerminationException import akka.stream.Materializer import akka.stream.scaladsl.Sink import akka.stream.scaladsl.Source -import org.scalatest.WordSpecLike import scala.concurrent.Future import scala.util.Success +import org.scalatest.wordspec.AnyWordSpecLike -class MaterializerForTypedSpec extends ScalaTestWithActorTestKit with WordSpecLike { +class MaterializerForTypedSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike { "Materialization in typed" should { diff --git a/akka-testkit/src/test/scala/akka/testkit/AbstractSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AbstractSpec.scala index 589b84584b..9de9a7db8b 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AbstractSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AbstractSpec.scala @@ -5,8 +5,8 @@ package akka.testkit import org.scalatest.BeforeAndAfterEach -import org.scalatest.Matchers -import org.scalatest.WordSpecLike +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike // we could migrate AkkaSpec to extend this -abstract class AbstractSpec extends WordSpecLike with Matchers with BeforeAndAfterEach +abstract class AbstractSpec extends AnyWordSpecLike with Matchers with BeforeAndAfterEach diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala index 0599831efa..833a4d288d 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala @@ -9,8 +9,9 @@ import java.lang.reflect.Modifier import org.scalactic.{ CanEqual, TypeCheckedTripleEquals } import language.postfixOps -import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } -import org.scalatest.Matchers +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import akka.actor.ActorSystem import akka.event.{ Logging, LoggingAdapter } @@ -92,7 +93,7 @@ object AkkaSpec { abstract class AkkaSpec(_system: ActorSystem) extends TestKit(_system) - with WordSpecLike + with AnyWordSpecLike with Matchers with BeforeAndAfterAll with WatchedByCoroner diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala index 05bcc7da48..e5bc37f12b 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpecSpec.scala @@ -5,8 +5,6 @@ package akka.testkit import language.postfixOps -import org.scalatest.WordSpec -import org.scalatest.Matchers import akka.actor._ import com.typesafe.config.ConfigFactory @@ -15,9 +13,11 @@ import scala.concurrent.duration._ import akka.actor.DeadLetter import akka.pattern.ask import com.github.ghik.silencer.silent +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec @silent -class AkkaSpecSpec extends WordSpec with Matchers { +class AkkaSpecSpec extends AnyWordSpec with Matchers { "An AkkaSpec" must { diff --git a/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala b/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala index 9fd7941972..da8d466465 100644 --- a/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/CoronerSpec.scala @@ -8,12 +8,12 @@ import java.io._ import java.lang.management.ManagementFactory import java.util.concurrent.Semaphore import java.util.concurrent.locks.ReentrantLock -import org.scalatest.WordSpec -import org.scalatest.Matchers import scala.concurrent.duration._ import scala.concurrent.Await +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class CoronerSpec extends WordSpec with Matchers { +class CoronerSpec extends AnyWordSpec with Matchers { private def captureOutput[A](f: PrintStream => A): (A, String) = { val bytes = new ByteArrayOutputStream() diff --git a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala index e26f1e00a7..88894c153a 100644 --- a/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala @@ -4,11 +4,12 @@ package akka.testkit -import org.scalatest.{ BeforeAndAfterAll, WordSpec } -import org.scalatest.Matchers +import org.scalatest.BeforeAndAfterAll import akka.actor.ActorSystem +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class DefaultTimeoutSpec extends WordSpec with Matchers with BeforeAndAfterAll with TestKitBase with DefaultTimeout { +class DefaultTimeoutSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with DefaultTimeout { implicit lazy val system = ActorSystem("AkkaCustomSpec") diff --git a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala index 05f0ad9ab9..5abbbe449e 100644 --- a/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala @@ -4,11 +4,12 @@ package akka.testkit -import org.scalatest.{ BeforeAndAfterAll, WordSpec } -import org.scalatest.Matchers import akka.actor.ActorSystem +import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class ImplicitSenderSpec extends WordSpec with Matchers with BeforeAndAfterAll with TestKitBase with ImplicitSender { +class ImplicitSenderSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with ImplicitSender { implicit lazy val system = ActorSystem("AkkaCustomSpec") diff --git a/akka-testkit/src/test/scala/akka/testkit/metrics/MetricsKitSpec.scala b/akka-testkit/src/test/scala/akka/testkit/metrics/MetricsKitSpec.scala index 904643e480..9b11bff17e 100644 --- a/akka-testkit/src/test/scala/akka/testkit/metrics/MetricsKitSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/metrics/MetricsKitSpec.scala @@ -6,8 +6,10 @@ package akka.testkit.metrics import org.scalatest._ import com.typesafe.config.ConfigFactory +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec -class MetricsKitSpec extends WordSpec with Matchers with BeforeAndAfter with BeforeAndAfterAll with MetricsKit { +class MetricsKitSpec extends AnyWordSpec with Matchers with BeforeAndAfter with BeforeAndAfterAll with MetricsKit { import scala.concurrent.duration._ diff --git a/project/Dependencies.scala b/project/Dependencies.scala index bea4ea8258..76b35c87ed 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -11,6 +11,7 @@ object Dependencies { import DependencyHelpers._ lazy val scalaTestVersion = settingKey[String]("The version of ScalaTest to use.") + lazy val scalaTestPlusVersion = settingKey[String]("The version of ScalaTestPlus to use.") lazy val scalaCheckVersion = settingKey[String]("The version of ScalaCheck to use.") lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.") @@ -37,12 +38,8 @@ object Dependencies { crossScalaVersions := Seq(scala212Version, scala213Version), scalaVersion := System.getProperty("akka.build.scalaVersion", crossScalaVersions.value.head), scalaCheckVersion := sys.props.get("akka.build.scalaCheckVersion").getOrElse("1.14.2"), - scalaTestVersion := { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, n)) if n >= 13 => "3.0.8" - case _ => "3.0.7" - } - }, + scalaTestVersion := "3.1.0", + scalaTestPlusVersion := "3.1.0.0", java8CompatVersion := { CrossVersion.partialVersion(scalaVersion.value) match { // java8-compat is only used in a couple of places for 2.13, @@ -115,6 +112,10 @@ object Dependencies { val mockito = "org.mockito" % "mockito-core" % "3.2.4" % "test" // MIT // changing the scalatest dependency must be reflected in akka-docs/rst/dev/multi-jvm-testing.rst val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % "test" } // ApacheV2 + val scalatestJUnit = Def.setting { "org.scalatestplus" %% "junit-4-12" % scalaTestPlusVersion.value % "test" } // ApacheV2 + val scalatestTestNG = Def.setting { "org.scalatestplus" %% "testng-6-7" % scalaTestPlusVersion.value % "test" } // ApacheV2 + val scalatestScalaCheck = Def.setting { "org.scalatestplus" %% "scalacheck-1-14" % scalaTestPlusVersion.value % "test" } // ApacheV2 + val scalatestMockito = Def.setting { "org.scalatestplus" %% "mockito-1-10" % scalaTestPlusVersion.value % "test" } // ApacheV2 val scalacheck = Def.setting { "org.scalacheck" %% "scalacheck" % scalaCheckVersion.value % "test" } // New BSD val pojosr = "com.googlecode.pojosr" % "de.kalpatec.pojosr.framework" % "0.2.1" % "test" // ApacheV2 val tinybundles = "org.ops4j.pax.tinybundles" % "tinybundles" % "3.0.0" % "test" // ApacheV2 @@ -156,6 +157,7 @@ object Dependencies { val junit = Compile.junit % "optional;provided;test" val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % "optional;provided;test" } // ApacheV2 + val scalatestJUnit = Def.setting { "org.scalatestplus" %% "junit-4-12" % scalaTestPlusVersion.value % "optional;provided;test" } // ApacheV2 val logback = Compile.logback % "optional;provided;test" // EPL 1.0 @@ -180,6 +182,8 @@ object Dependencies { val actorTests = l ++= Seq( Test.junit, Test.scalatest.value, + Test.scalatestJUnit.value, + Test.scalatestScalaCheck.value, Test.commonsCodec, Test.commonsMath, Test.scalacheck.value, @@ -188,7 +192,7 @@ object Dependencies { Provided.activation // dockerClient needs javax.activation.DataSource in JDK 11+ ) - val actorTestkitTyped = l ++= Seq(Provided.logback, Provided.junit, Provided.scalatest.value) + val actorTestkitTyped = l ++= Seq(Provided.logback, Provided.junit, Provided.scalatest.value, Provided.scalatestJUnit.value) val remoteDependencies = Seq(netty, aeronDriver, aeronClient) val remoteOptionalDependencies = remoteDependencies.map(_ % "optional") @@ -210,7 +214,7 @@ object Dependencies { Test.scalatest.value, Test.commonsIo) - val clusterMetrics = l ++= Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito) + val clusterMetrics = l ++= Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito, Test.scalatestMockito.value) val distributedData = l ++= Seq(lmdb, Test.junit, Test.scalatest.value) @@ -220,6 +224,7 @@ object Dependencies { Provided.levelDB, Provided.levelDBNative, Test.scalatest.value, + Test.scalatestJUnit.value, Test.junit, Test.commonsIo, Test.commonsCodec) @@ -271,9 +276,9 @@ object Dependencies { lazy val streamTestkit = l ++= Seq(Test.scalatest.value, Test.scalacheck.value, Test.junit) - lazy val streamTests = l ++= Seq(Test.scalatest.value, Test.scalacheck.value, Test.junit, Test.commonsIo, Test.jimfs) + lazy val streamTests = l ++= Seq(Test.scalatest.value, Test.scalacheck.value, Test.scalatestScalaCheck.value, Test.junit, Test.commonsIo, Test.jimfs) - lazy val streamTestsTck = l ++= Seq(Test.scalatest.value, Test.scalacheck.value, Test.junit, Test.reactiveStreamsTck) + lazy val streamTestsTck = l ++= Seq(Test.scalatest.value, Test.scalatestTestNG.value, Test.scalacheck.value, Test.junit, Test.reactiveStreamsTck) }