From f53fed8234bd7cf7654dec9b3a5b43e9b7247d0b Mon Sep 17 00:00:00 2001 From: Tomasz Perek Date: Thu, 5 Dec 2019 13:19:11 +0100 Subject: [PATCH] Update scalatest dependency to v.3.1.0 --- project/Dependencies.scala | 2 +- stamina-core/src/test/scala/stamina/StaminaSpec.scala | 4 +++- .../src/test/scala/stamina/json/StaminaJsonSpec.scala | 4 +++- .../src/main/scala/stamina/testkit/StaminaTestKit.scala | 4 ++-- .../stamina/testkit/ScalatestTestGenerationSpec.scala | 9 +++++---- .../test/scala/stamina/testkit/StaminaTestKitSpec.scala | 4 +++- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 357ac8b..b79f75f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,7 +6,7 @@ object Dependencies { val akkaActor = "com.typesafe.akka" %% "akka-actor" % "2.5.25" val sprayJson = "io.spray" %% "spray-json" % "1.3.5" val jsonLenses = "net.virtual-void" %% "json-lenses" % "0.6.2" - val scalatest = "org.scalatest" %% "scalatest" % "3.0.8" + val scalatest = "org.scalatest" %% "scalatest" % "3.1.0" // format: ON // Dependency scoping functions diff --git a/stamina-core/src/test/scala/stamina/StaminaSpec.scala b/stamina-core/src/test/scala/stamina/StaminaSpec.scala index 5f1af96..7a8c1dd 100644 --- a/stamina-core/src/test/scala/stamina/StaminaSpec.scala +++ b/stamina-core/src/test/scala/stamina/StaminaSpec.scala @@ -1,9 +1,11 @@ package stamina import org.scalatest._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike abstract class StaminaSpec - extends WordSpecLike + extends AnyWordSpecLike with Matchers with OptionValues with TryValues diff --git a/stamina-json/src/test/scala/stamina/json/StaminaJsonSpec.scala b/stamina-json/src/test/scala/stamina/json/StaminaJsonSpec.scala index c8b5bd8..7c31780 100644 --- a/stamina-json/src/test/scala/stamina/json/StaminaJsonSpec.scala +++ b/stamina-json/src/test/scala/stamina/json/StaminaJsonSpec.scala @@ -1,9 +1,11 @@ package stamina.json import org.scalatest._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike abstract class StaminaJsonSpec - extends WordSpecLike + extends AnyWordSpecLike with Matchers with OptionValues with TryValues diff --git a/stamina-testkit/src/main/scala/stamina/testkit/StaminaTestKit.scala b/stamina-testkit/src/main/scala/stamina/testkit/StaminaTestKit.scala index 997d69f..3f70d9a 100644 --- a/stamina-testkit/src/main/scala/stamina/testkit/StaminaTestKit.scala +++ b/stamina-testkit/src/main/scala/stamina/testkit/StaminaTestKit.scala @@ -6,7 +6,7 @@ import java.util.Base64 import scala.util._ -trait StaminaTestKit { self: org.scalatest.WordSpecLike => +trait StaminaTestKit { self: org.scalatest.wordspec.AnyWordSpecLike => val defaultSampleId = "default" case class PersistableSample[FromVersion <: Version: VersionInfo](sampleId: String, persistable: AnyRef, description: Option[String]) { @@ -20,7 +20,7 @@ trait StaminaTestKit { self: org.scalatest.WordSpecLike => def sample(sampleId: String, persistable: AnyRef) = new PersistableSample[V1](sampleId, persistable, Some(sampleId)) def sample(sampleId: String, persistable: AnyRef, description: String) = new PersistableSample[V1](sampleId, persistable, Some(description)) - implicit class TestablePersisters(persisters: Persisters) extends org.scalatest.Matchers { + implicit class TestablePersisters(persisters: Persisters) extends org.scalatest.matchers.should.Matchers { def generateTestsFor(samples: PersistableSample[_]*): Unit = { samples.foreach { sample => generateRoundtripTestFor(sample) diff --git a/stamina-testkit/src/test/scala/stamina/testkit/ScalatestTestGenerationSpec.scala b/stamina-testkit/src/test/scala/stamina/testkit/ScalatestTestGenerationSpec.scala index b54be1e..d9d963c 100644 --- a/stamina-testkit/src/test/scala/stamina/testkit/ScalatestTestGenerationSpec.scala +++ b/stamina-testkit/src/test/scala/stamina/testkit/ScalatestTestGenerationSpec.scala @@ -6,6 +6,7 @@ import java.io.File import org.scalatest._ import org.scalatest.events._ import org.scalatest.matchers.{ BePropertyMatchResult, BePropertyMatcher } +import org.scalatest.wordspec.AnyWordSpecLike import scala.reflect.ClassTag @@ -20,7 +21,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec { "A spec generated by StaminaTestKit" when { "there is only version 1" should { - val spec = new StaminaTestKit with WordSpecLike { + val spec = new StaminaTestKit with AnyWordSpecLike { val persisters = Persisters(ItemPersister("item1")) "TestDomainSerialization" should { persisters.generateTestsFor( @@ -66,7 +67,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec { } "the sample is only suitable for version 2 and up" should { - val spec = new StaminaTestKit with WordSpecLike { + val spec = new StaminaTestKit with AnyWordSpecLike { val persisters = Persisters(ItemPersister("item2")) "TestDomainSerialization" should { persisters.generateTestsFor( @@ -86,7 +87,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec { } "a sample is available for both version 1 and (the migrated event) version 2" should { - val spec = new StaminaTestKit with WordSpecLike { + val spec = new StaminaTestKit with AnyWordSpecLike { val persisters = Persisters(ItemPersister("item1")) "TestDomainSerialization" should { persisters.generateTestsFor( @@ -108,7 +109,7 @@ class ScalatestTestGenerationSpec extends StaminaTestKitSpec { } } - private def execSpec(spec: WordSpecLike): EventRecordingReporter = { + private def execSpec(spec: AnyWordSpecLike): EventRecordingReporter = { val myRep = new EventRecordingReporter spec.run(None, Args(myRep, Stopper.default, Filter(), ConfigMap.empty, None, new Tracker, Set.empty)) myRep diff --git a/stamina-testkit/src/test/scala/stamina/testkit/StaminaTestKitSpec.scala b/stamina-testkit/src/test/scala/stamina/testkit/StaminaTestKitSpec.scala index 9d3f326..d7e9a87 100644 --- a/stamina-testkit/src/test/scala/stamina/testkit/StaminaTestKitSpec.scala +++ b/stamina-testkit/src/test/scala/stamina/testkit/StaminaTestKitSpec.scala @@ -2,9 +2,11 @@ package stamina package testkit import org.scalatest._ +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike abstract class StaminaTestKitSpec - extends WordSpecLike + extends AnyWordSpecLike with Matchers with OptionValues with TryValues