mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
malformed parameterized: meta arguments source support (IDEA-177110)
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ class JUnit5MalformedParameterizedInspection : BaseJavaBatchLocalInspectionTool(
|
||||
|
||||
var noMultiArgsProvider = true
|
||||
var source : PsiAnnotation? = null
|
||||
AnnotationUtil.findAnnotations(method, JUnitCommonClassNames.SOURCE_ANNOTATIONS).forEach {
|
||||
MetaAnnotationUtil.findMetaAnnotations(method, JUnitCommonClassNames.SOURCE_ANNOTATIONS).forEach {
|
||||
when (it.qualifiedName) {
|
||||
JUnitCommonClassNames.ORG_JUNIT_JUPITER_PARAMS_PROVIDER_METHOD_SOURCE -> {
|
||||
checkMethodSource(method, it)
|
||||
|
||||
+3
@@ -54,6 +54,9 @@ public class JUnit5MalformedParameterizedTest extends LightInspectionTestCase {
|
||||
"public @interface CsvSource {String[] value();}");
|
||||
addEnvironmentClass("package org.junit.jupiter.params.provider;\n" +
|
||||
"public interface Arguments {static Arguments of(Object... arguments){}}\n");
|
||||
|
||||
addEnvironmentClass("package org.junit.jupiter.params.provider;\n" +
|
||||
"public @interface ArgumentsSource {}");
|
||||
}
|
||||
|
||||
public void testMalformedSources() { doTest(); }
|
||||
|
||||
@@ -64,3 +64,12 @@ class ParameterizedTestsDemo {
|
||||
@CsvSource({"foo, 1"})
|
||||
void testWithCsvSource(String first, int second) {}
|
||||
}
|
||||
|
||||
@org.junit.jupiter.params.provider.ArgumentsSource()
|
||||
@interface CustomSource { }
|
||||
|
||||
class CustomArgProviderTest {
|
||||
@ParameterizedTest
|
||||
@CustomSource
|
||||
void jsonSourceTest(String param) { }
|
||||
}
|
||||
Reference in New Issue
Block a user