junit 5: fix source signature for primitive arrays (IDEA-189846)

This commit is contained in:
Anna.Kozlova
2018-04-09 14:53:11 +02:00
parent e0040a1755
commit 90b3b2f0aa
2 changed files with 4 additions and 1 deletions

View File

@@ -297,6 +297,9 @@ public class ClassUtil {
public String visitArrayType(PsiArrayType arrayType) {
PsiType componentType = arrayType.getComponentType();
String typePresentation = componentType.accept(this);
if (arrayType.getDeepComponentType() instanceof PsiPrimitiveType) {
return typePresentation + "[]";
}
if (componentType instanceof PsiClassType) {
typePresentation = "L" + typePresentation + ";";
}

View File

@@ -40,7 +40,7 @@ public class JUnit5NamingTest extends JUnit5CodeInsightTest {
Arrays.stream(file.getClasses()[0].getMethods())
.map(method -> JUnitConfiguration.Data.getMethodPresentation(method))
.toArray(String[]::new);
Assertions.assertArrayEquals(new String[] {"foo([int)",
Assertions.assertArrayEquals(new String[] {"foo(int[])",
"foo(int)",
"foo([Ljava.lang.String;)",
"foo(java.lang.String)",