Java 未找到给定Include的测试(IntelliJ&;Groovy)
我正在尝试使用IntelliJ和./gradlew命令运行用Groovy编写的单元测试。 建设项目运作良好,但测试似乎没有找到。在IntelliJ中运行测试会抛出以下代码:Java 未找到给定Include的测试(IntelliJ&;Groovy),java,testing,intellij-idea,groovy,Java,Testing,Intellij Idea,Groovy,我正在尝试使用IntelliJ和./gradlew命令运行用Groovy编写的单元测试。 建设项目运作良好,但测试似乎没有找到。在IntelliJ中运行测试会抛出以下代码: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > No tests found for given includes: [path.to.SomeTestClass](filt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [path.to.SomeTestClass](filter.includeTestsMatching)
在我的项目中找不到任何测试,下面是我在
src->main->test->groovy
目录
import spock.lang.Specification
class SomeTestClass extends Specification {
def "A test that should work"() {
given:
def someNumber = 1
when:
def anotherNumber = someNumber + 1
then:
anotherNumber == 2
}
}
非常感谢您的帮助 解决方案:
通过将以下行添加到build.gradle中解决了此问题:
test {
useJUnitPlatform()
}
“测试”任务在IDE外的控制台中运行正常吗?@y.bedrov谢谢您的回复!我得到一个
>当尝试在terminalIs中运行时,没有名为改进的\u POM\u支持的功能
是否可以共享示例项目示例以供调查?