Skip to content

Commit 34616a2

Browse files
committed
used = for unit methods to support scala 3
1 parent 8de20c0 commit 34616a2

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ lazy val scala_akka_dependencies: Seq[ModuleID] = Seq(
201201
lazy val scala_test_junit4 = (project in file("scala-test-junit4"))
202202
.settings(
203203
name := "scala-test-junit4",
204+
scalaVersion := scala3Version,
204205
libraryDependencies ++=
205206
Seq(
206207
"org.scalatestplus" %% "junit-4-13" % "3.2.17.0" % Test,

scala-test-junit4/src/test/scala-2/com/baeldung/scala/junit4/IntJunitTests.scala renamed to scala-test-junit4/src/test/scala/com/baeldung/scala/junit4/IntJunitTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import org.junit.Assert._
66
class IntJunitTests {
77

88
@Test
9-
def testOneIsPositive {
9+
def testOneIsPositive = {
1010
assertTrue(1 > 0)
1111
}
1212

1313
@Test
14-
def testMinusOneIsNegative {
14+
def testMinusOneIsNegative = {
1515
assertTrue(-1 < 0)
1616
}
1717
}

scala-test-junit4/src/test/scala-2/com/baeldung/scala/junit4/STAssertionsTests.scala renamed to scala-test-junit4/src/test/scala/com/baeldung/scala/junit4/STAssertionsTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class STAssertionsTests extends AssertionsForJUnit {
88
private final val myInt = 1
99

1010
@Test
11-
def testAssertJUnitStyle() {
11+
def testAssertJUnitStyle() = {
1212
assertEquals(myInt, 1)
1313
assertTrue(myInt > 0)
1414

@@ -21,7 +21,7 @@ class STAssertionsTests extends AssertionsForJUnit {
2121
}
2222

2323
@Test
24-
def testAssertScalaTestStyle() {
24+
def testAssertScalaTestStyle() = {
2525
assert(myInt == 1)
2626
assert(myInt.isValidInt)
2727
intercept[ArithmeticException] {

scala-test-junit4/src/test/scala-2/com/baeldung/scala/junit4/StringJunitTests.scala renamed to scala-test-junit4/src/test/scala/com/baeldung/scala/junit4/StringJunitTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.junit.Assert._
66
class StringJunitTests {
77

88
@Test
9-
def testEmptyStringLengthIsZero {
9+
def testEmptyStringLengthIsZero = {
1010
assertEquals("".length, 0)
1111
}
1212
}

0 commit comments

Comments
 (0)