如何 运行 从测试 class scala 进行单一测试?

How to run single test from test class scala?

我有这样的 class 测试:

class TestSuite {

  @Test def one(): Unit = {
    println(1)
  }

  @Test def two(): Unit = {
    println(2)
  }

  @Test def three(): Unit = {
    println(3)
  }
}

我只想 运行 以名称 three 进行示例测试,而不要 运行 其他名称。我有 2.13.6 scala 版本的 Maven 项目,所以我尝试通过此命令 运行 单一测试:

 mvn test -Dtest="TestSuite@two"

但我收到了下面发布的错误:

 No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)

我在官方 maven 文档上看到了这个命令,所以我认为它会很好地工作,但事实并非如此。所以,也许我做错了,我们有另一个命令 运行 测试 class 中的一个测试并忽略另一个测试?

and we have another command for running one test from testing class and ignoring another ones?

这应该是可能的,但是使用 ScalaTest with maven, or ScalaTest with sbt