1

I'm using :

  • scala 2.12.15
  • Java 17
  • scalatest_2.12:3.2.15
  • JUnit 5
  • Gradle

With this very simple codes in my test folder:

import org.scalatest.flatspec.AnyFlatSpec


class MyTestSpec extends AnyFlatSpec {

  "An empty Set" should "have size 0" in {
    assert(Set.empty.size === 0)
  }
}

when I try to execute this test, I have : No tests found...

When I Use Junit 4, it's OK, but with Junit 5, KO.

**remark **: In my gradle, I have :

test {
    useJUnitPlatform()
}

Is AnyFlatSpec don't support JUnit 5 ? Is there another solution ?

Thanks for your help !

0 Answers0