org.gradle.api.tasks.testing.junit.JUnitOptions.includeGroups()适用于参数类型:(java.lang.String)值:[NodeTests]

org.gradle.api.tasks.testing.junit.JUnitOptions.includeGroups()适用于参数类型:(java.lang.String)值:[NodeTests],java,junit,gradle,Java,Junit,Gradle,我添加了这个gradle任务 然后我得到这个错误: FAILURE: Build failed with an exception. * Where: Build file '/Users/eladb/WorkspaceQa/java/UsersServer/build.gradle' line: 98 * What went wrong: A problem occurred evaluating root project 'UsersServer'. > No signature

我添加了这个gradle任务

然后我得到这个错误:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/eladb/WorkspaceQa/java/UsersServer/build.gradle' line: 98

* What went wrong:
A problem occurred evaluating root project 'UsersServer'.
> No signature of method: org.gradle.api.tasks.testing.junit.JUnitOptions.includeGroups() is applicable for argument types: (java.lang.String) values: [NoDbTests]
我的语法有什么问题

我看了这个教程:

test {
    useJUnit {
          includeCategories 'linqmap.users.interfaces.NoDbTests'
    //    excludeCategories 'org.gradle.junit.CategoryB'
    }
}
我应该使用
“excludeCategories”
而不是
“includeGroups()”

应该是

test {
    useJUnit {
          includeCategories 'linqmap.users.interfaces.NoDbTests'
    }
}

请包含正在运行的脚本中的snipit。您发布的脚本似乎与错误无关。
test {
    useJUnit {
          includeCategories 'linqmap.users.interfaces.NoDbTests'
    }
}