Skip to content

Commit dc6eebf

Browse files
committed
Upgraded scalatest to latest version
1 parent 51ca879 commit dc6eebf

File tree

209 files changed

+524
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+524
-511
lines changed

build.sbt

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,41 @@ ThisBuild / version := "1.0-SNAPSHOT"
44
ThisBuild / organization := "com.baeldung"
55
ThisBuild / organizationName := "core-scala"
66

7-
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.2" % Test
87
val junit = "com.novocode" % "junit-interface" % "0.11" % "test"
98
val catsEffect = "org.typelevel" %% "cats-effect" % "2.1.4"
109
val catsCore = "org.typelevel" %% "cats-effect" % "2.1.4"
1110

11+
val scalaTestDeps = Seq(
12+
"org.scalatest" %% "scalatest" % "3.2.15" % Test,
13+
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.15" % Test,
14+
"org.scalatest" %% "scalatest-wordspec" % "3.2.15" % Test,
15+
"org.scalatest" %% "scalatest-flatspec" % "3.2.15" % Test,
16+
)
17+
18+
1219
lazy val scala_core = (project in file("scala-core"))
1320
.settings(
1421
name := "scala-core",
1522
libraryDependencies ++=
1623
Seq(
17-
scalaTest,
1824
junit,
1925
catsCore,
2026
catsEffect
21-
)
27+
) ++ scalaTestDeps
2228
)
2329

2430
lazy val scala_core_2 = (project in file("scala-core-2"))
2531
.settings(
2632
name := "scala-core-2",
27-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
33+
libraryDependencies ++= scalaTestDeps,
2834
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test,
2935
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
3036
)
3137

3238
lazy val scala_core_3 = (project in file("scala-core-3"))
3339
.settings(
3440
name := "scala-core-3",
35-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
41+
libraryDependencies ++= scalaTestDeps,
3642
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
3743
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaV,
3844
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.0.0-M1"
@@ -41,7 +47,7 @@ lazy val scala_core_3 = (project in file("scala-core-3"))
4147
lazy val scala_core_4 = (project in file("scala-core-4"))
4248
.settings(
4349
name := "scala-core-4",
44-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
50+
libraryDependencies ++= scalaTestDeps,
4551
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
4652
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaV,
4753
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.0.0-M1"
@@ -50,7 +56,7 @@ lazy val scala_core_4 = (project in file("scala-core-4"))
5056
lazy val scala_core_5 = (project in file("scala-core-5"))
5157
.settings(
5258
name := "scala-core-5",
53-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
59+
libraryDependencies ++= scalaTestDeps,
5460
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
5561
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaV,
5662
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.0.0-M1",
@@ -62,15 +68,15 @@ lazy val scala_core_5 = (project in file("scala-core-5"))
6268
lazy val scala_core_6 = (project in file("scala-core-6"))
6369
.settings(
6470
name := "scala-core-6",
65-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
71+
libraryDependencies ++= scalaTestDeps,
6672
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test,
6773
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
6874
)
6975

7076
lazy val scala_core_7 = (project in file("scala-core-7"))
7177
.settings(
7278
name := "scala-core-7",
73-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
79+
libraryDependencies ++= scalaTestDeps,
7480
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test,
7581
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
7682
libraryDependencies += "com.github.scopt" %% "scopt" % "4.0.1",
@@ -84,15 +90,15 @@ lazy val scala_core_8 = (project in file("scala-core-8"))
8490
.settings(
8591
name := "scala-core-8",
8692
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
87-
libraryDependencies += scalaTest,
93+
libraryDependencies ++= scalaTestDeps,
8894
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test"
8995
// scalacOptions += "-Ymacro-debug-lite"
9096
)
9197

9298
lazy val scala_core_io = (project in file("scala-core-io"))
9399
.settings(
94100
name := "scala-core-io",
95-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
101+
libraryDependencies ++= scalaTestDeps,
96102
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
97103
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaV
98104
)
@@ -101,44 +107,42 @@ lazy val scala_core_oop = (project in file("scala-core-oop"))
101107
.settings(
102108
name := "scala-core-oop",
103109
libraryDependencies ++=
104-
Seq(catsCore, scalaTest, junit)
110+
Seq(catsCore, junit) ++ scalaTestDeps
105111
)
106112

107113
lazy val scala_core_fp = (project in file("scala-core-fp"))
108114
.settings(
109115
name := "scala-core-fp",
110116
libraryDependencies ++=
111-
Seq(catsCore, scalaTest, junit)
117+
Seq(catsCore, junit) ++ scalaTestDeps
112118
)
113119

114120
lazy val scala_lang = (project in file("scala-lang"))
115121
.settings(
116122
name := "scala-lang",
117123
libraryDependencies ++=
118-
Seq(scalaTest, junit)
124+
Seq(junit) ++ scalaTestDeps
119125
)
120126

121127
lazy val scala_lang_2 = (project in file("scala-lang-2"))
122128
.settings(
123129
name := "scala-lang",
124130
libraryDependencies ++=
125-
Seq(scalaTest, junit)
131+
Seq(junit) ++ scalaTestDeps
126132
)
127133

128134
lazy val scala_core_collections = (project in file("scala-core-collections"))
129135
.settings(
130136
name := "scala-core-collections",
131137
libraryDependencies ++= Seq(
132-
scalaTest,
133138
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4"
134-
)
139+
) ++ scalaTestDeps,
135140
)
136141

137142
lazy val scala_core_collections_2 = (project in file("scala-core-collections-2"))
138143
.settings(
139144
name := "scala-core-collections-2",
140-
libraryDependencies +=
141-
"org.scalatest" %% "scalatest" % "3.2.14" % Test
145+
libraryDependencies ++= scalaTestDeps,
142146
)
143147

144148
lazy val scala_test = (project in file("scala-test"))
@@ -147,10 +151,9 @@ lazy val scala_test = (project in file("scala-test"))
147151
libraryDependencies ++=
148152
Seq(
149153
"org.scalatestplus" %% "mockito-3-4" % "3.2.10.0" % Test,
150-
"org.scalatest" %% "scalatest" % "3.2.11" % Test,
151154
junit,
152155
"org.scalamock" %% "scalamock" % "4.4.0" % Test
153-
)
156+
) ++ scalaTestDeps
154157
)
155158

156159
lazy val scala_akka_dependencies: Seq[ModuleID] = Seq(
@@ -161,11 +164,10 @@ lazy val scala_akka_dependencies: Seq[ModuleID] = Seq(
161164
"com.typesafe.akka" %% "akka-stream" % "2.6.19",
162165
"org.mongodb.scala" %% "mongo-scala-driver" % "2.9.0",
163166
"com.lightbend.akka" %% "akka-stream-alpakka-file" % "2.0.2",
164-
"org.scalatest" %% "scalatest" % "3.1.2" % Test,
165167
"com.novocode" % "junit-interface" % "0.11" % "test",
166168
"de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.2.0" % Test,
167169
"com.typesafe.akka" %% "akka-http" % "10.2.7"
168-
)
170+
) ++ scalaTestDeps
169171
lazy val scala_test_junit4 = (project in file("scala-test-junit4"))
170172
.settings(
171173
name := "scala-test-junit4",
@@ -193,8 +195,7 @@ lazy val scala_akka_2 = (project in file("scala-akka-2"))
193195
"com.typesafe.akka" %% "akka-http-spray-json" % "10.2.10",
194196
"com.lightbend.akka" %% "akka-stream-alpakka-sse" % "4.0.0",
195197
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.19" % Test,
196-
"org.scalatest" %% "scalatest" % "3.0.8" % Test
197-
)
198+
) ++ scalaTestDeps
198199
)
199200
val monocleVersion = "2.0.4"
200201
val slickVersion = "3.3.2"
@@ -207,7 +208,7 @@ val reactiveMongo = "1.0.3"
207208
lazy val scala_libraries = (project in file("scala-libraries"))
208209
.settings(
209210
name := "scala-libraries",
210-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
211+
libraryDependencies ++= scalaTestDeps,
211212
libraryDependencies ++= Seq(
212213
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
213214
"com.github.julien-truffaut" %% "monocle-macro" % monocleVersion,
@@ -239,7 +240,7 @@ lazy val scala_libraries_2 = (project in file("scala-libraries-2"))
239240
.settings(
240241
scalaVersion := "2.12.15",
241242
name := "scala-libraries",
242-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
243+
libraryDependencies ++= scalaTestDeps,
243244
libraryDependencies ++= Seq(
244245
"io.circe" %% "circe-core" % circeVersion,
245246
"io.circe" %% "circe-generic" % circeVersion,
@@ -268,10 +269,9 @@ lazy val scala_libraries_2 = (project in file("scala-libraries-2"))
268269
),
269270
libraryDependencies ++= Seq(
270271
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.16" % Test,
271-
"org.scalatest" %% "scalatest" % "3.1.4" % Test,
272272
"org.scalacheck" %% "scalacheck" % "1.14.1" % Test,
273273
"com.lihaoyi" %% "requests" % "0.6.9"
274-
),
274+
) ++ scalaTestDeps,
275275
libraryDependencies ++= Seq(
276276
"com.sksamuel.elastic4s" %% "elastic4s-client-esjava" % elastic4sVersion,
277277
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,
@@ -284,7 +284,7 @@ val http4sVersion = "0.23.10"
284284
lazy val scala_libraries_3 = (project in file("scala-libraries-3"))
285285
.settings(
286286
name := "scala-libraries",
287-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
287+
libraryDependencies ++= scalaTestDeps,
288288
libraryDependencies ++= Seq(
289289
"org.apache.spark" %% "spark-core" % sparkVersion,
290290
"org.apache.spark" %% "spark-sql" % sparkVersion
@@ -311,7 +311,7 @@ lazy val scala_libraries_3 = (project in file("scala-libraries-3"))
311311
lazy val scala_libraries_os = (project in file("scala-libraries-os"))
312312
.settings(
313313
name := "scala-libraries",
314-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
314+
libraryDependencies ++= scalaTestDeps,
315315
libraryDependencies ++= Seq(
316316
"org.apache.logging.log4j" %% "log4j-api-scala" % "12.0",
317317
"org.apache.logging.log4j" % "log4j-core" % "2.13.0" % Runtime
@@ -324,7 +324,7 @@ lazy val scala_libraries_4 = (project in file("scala-libraries-4"))
324324
name := "scala-libraries-4",
325325
libraryDependencies += "com.lihaoyi" %% "utest" % "0.8.1" % "test",
326326
testFrameworks += new TestFramework("utest.runner.Framework"),
327-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
327+
libraryDependencies ++= scalaTestDeps,
328328
libraryDependencies ++= Seq(
329329
"org.scala-lang.modules" %% "scala-async" % "1.0.1",
330330
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
@@ -340,21 +340,25 @@ lazy val scala_libraries_4 = (project in file("scala-libraries-4"))
340340
lazy val scala_strings = (project in file("scala-strings"))
341341
.settings(
342342
name := "scala-strings",
343-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
343+
libraryDependencies ++= scalaTestDeps,
344344
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
345345
)
346346

347347
lazy val scala_design_patterns = (project in file("scala-design-patterns"))
348348
.settings(
349349
name := "scala-design-patterns",
350-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
350+
libraryDependencies ++= scalaTestDeps,
351351
libraryDependencies += "org.scalamock" %% "scalamock" % "4.4.0" % Test,
352352
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test
353353
)
354354

355-
lazy val scala3_lang = project in file("scala3-lang")
355+
lazy val scala3_lang = (project in file("scala3-lang")).settings(
356+
libraryDependencies ++= scalaTestDeps
357+
)
356358

357-
lazy val scala3_lang_2 = project in file("scala3-lang-2")
359+
lazy val scala3_lang_2 = (project in file("scala3-lang-2")).settings(
360+
libraryDependencies ++= scalaTestDeps
361+
)
358362

359363
lazy val cats_effects = (project in file("cats-effects"))
360364
.settings(
@@ -411,7 +415,5 @@ lazy val scala212 = (project in file("scala212"))
411415
.settings(
412416
scalaVersion := "2.12.17",
413417
name := "scala212",
414-
libraryDependencies ++= Seq(
415-
scalaTest
416-
)
418+
libraryDependencies ++= scalaTestDeps
417419
)

cats-effects/src/main/scala/com/baeldung/scala/catseffects/NotParallelApp.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.catseffects
22

33
import cats.effect.{ExitCode, IO, IOApp}
4-
import com.baeldung.scala.catseffects.Utils.ShowThread
54
import cats.implicits._
5+
import com.baeldung.scala.catseffects.Utils.ShowThread
66

77
object NotParallelApp extends IOApp {
88
val tasks: List[IO[Int]] = (1 to 10).map(IO.pure).map(_.showThread).toList

cats-effects/src/main/scala/com/baeldung/scala/catseffects/ParallelApp.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.catseffects
22

33
import cats.effect.{ExitCode, IO, IOApp}
4-
import com.baeldung.scala.catseffects.Utils.ShowThread
54
import cats.implicits._
5+
import com.baeldung.scala.catseffects.Utils.ShowThread
66

77
object ParallelApp extends IOApp {
88
val tasks: List[IO[Int]] = (1 to 10).map(IO.pure).map(_.showThread).toList

cats-effects/src/main/scala/com/baeldung/scala/differences/Differences.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.differences
2-
import cats.effect.IO
3-
import scala.concurrent.duration._
2+
import cats.effect.{IO, IOApp}
43
import cats.effect.kernel.Deferred
5-
import cats.effect.IOApp
4+
5+
import scala.concurrent.duration._
66

77
object Differences extends IOApp.Simple {
88

cats-effects/src/main/scala/com/baeldung/scala/differences/FlatEvalDiff.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.baeldung.scala.differences
22

3-
import cats.effect.IOApp
4-
import cats.effect.IO
5-
import cats.effect.Resource
6-
import cats.effect.std.Random
3+
import cats.effect.{IO, IOApp, Resource}
74

85
object FlatEvalDiff extends IOApp.Simple {
96

cats-effects/src/main/scala/com/baeldung/scala/fibers/Fibers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.fibers
22

3-
import cats.effect.{FiberIO, IO, IOApp, OutcomeIO}
4-
import IOExtensions._
53
import cats.effect.kernel.Outcome
4+
import cats.effect.{FiberIO, IO, IOApp, OutcomeIO}
5+
import com.baeldung.scala.fibers.IOExtensions._
66

77
import scala.concurrent.duration._
88
import scala.util.Random

cats-effects/src/main/scala/com/baeldung/scala/resources/ResourceHandling.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package com.baeldung.scala.resources
22

3-
import cats.effect.IO
4-
import java.io.File
5-
import scala.io.Source
6-
import cats.effect.IOApp
7-
import scala.io.BufferedSource
3+
import cats.effect.{IO, IOApp, Resource}
4+
85
import java.io.FileWriter
9-
import cats.effect.Resource
6+
import scala.io.Source
107

118
object ResourceHandling extends IOApp.Simple {
129

doobie/src/main/scala/com/baeldung/scala/doobie/DoobieFragments.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.doobie
22

33
import cats.effect.{IO, IOApp}
4-
import doobie.{Fragment, Transactor}
54
import doobie.implicits._
5+
import doobie.{Fragment, Transactor}
66

77
object DoobieFragments extends IOApp.Simple {
88

doobie/src/main/scala/com/baeldung/scala/doobie/DoobieQuickStart.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.scala.doobie
22

33
import cats.effect.{IO, IOApp}
4-
import doobie.{ConnectionIO, Transactor}
54
import doobie.implicits._
5+
import doobie.{ConnectionIO, Transactor}
66

77
// Equivalent to world db city table
88
case class City(id: Long, name: String, countryCode: String, district: String, population: Int)

play-scala/dependency-injection/test/macwire/service/ServiceWithRemoteCallTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package macwire.service
22

33
import macwire.components.{ApiComponents, MockApiComponents, ServiceComponents}
4-
import org.scalatest.WordSpec
4+
import org.scalatest.wordspec.AnyWordSpec
55

6-
class ServiceWithRemoteCallTest extends WordSpec {
6+
class ServiceWithRemoteCallTest extends AnyWordSpec {
77

88
"ServiceWithRemoteCall call" should {
99

0 commit comments

Comments
 (0)