[java, fix, test] move an internal test into a separate test.

reason: an additional annotation @RunWith(Enclosed.class) override @RunWith(Parameterized.class)
result: some tests are not running

GitOrigin-RevId: 5979ee327eb23dd6ded7c8e2597ffd6503acfa23
This commit is contained in:
Aleksey Dobrynin
2023-11-13 17:41:26 +00:00
committed by intellij-monorepo-bot
parent 8e47257ec4
commit f97829c4d9
4 changed files with 39 additions and 18 deletions
@@ -1,4 +1,4 @@
// "Replace with 'computeIfAbsent' method call" "INFORMATION"
// "Replace with 'computeIfAbsent' method call" "GENERIC_ERROR_OR_WARNING"
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -1,4 +1,4 @@
// "Replace with 'computeIfAbsent' method call" "INFORMATION"
// "Replace with 'computeIfAbsent' method call" "GENERIC_ERROR_OR_WARNING"
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -5,11 +5,7 @@ import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCa
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.java18api.Java8MapApiInspection;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
@RunWith(Enclosed.class)
public class Java8MapApiInspectionTest extends LightQuickFixParameterizedTestCase {
@Override
protected LocalInspectionTool @NotNull [] configureLocalInspectionTools() {
@@ -18,18 +14,6 @@ public class Java8MapApiInspectionTest extends LightQuickFixParameterizedTestCas
return new LocalInspectionTool[]{inspection};
}
public static class ImplTest {
@Test
public void testNameCandidate() {
assertEquals("e", Java8MapApiInspection.getNameCandidate("element"));
assertEquals("t", Java8MapApiInspection.getNameCandidate("accessToken"));
assertEquals("s", Java8MapApiInspection.getNameCandidate("SQL"));
assertEquals("n", Java8MapApiInspection.getNameCandidate("myUserName"));
assertEquals("v", Java8MapApiInspection.getNameCandidate("___VAR"));
assertEquals("k", Java8MapApiInspection.getNameCandidate("_1"));
}
}
@Override
protected String getBasePath() {
return "/inspection/java8MapApi";
@@ -0,0 +1,37 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.java.codeInspection.java18api;
import com.intellij.codeInspection.java18api.Java8MapApiInspection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import static org.junit.Assert.assertEquals;
@RunWith(Parameterized.class)
public class Java8TestNameCandidateTest {
private final String expected;
private final String actual;
public Java8TestNameCandidateTest(String expected, String actual) {
this.expected = expected;
this.actual = actual;
}
@Parameterized.Parameters
public static Object[][] primeNumbers() {
return new Object[][]{
{"e", "element"},
{"t", "accessToken"},
{"s", "SQL"},
{"n", "myUserName"},
{"v", "___VAR"},
{"k", "_1"},
};
}
@Test
public void testNameCandidate() {
assertEquals(expected, Java8MapApiInspection.getNameCandidate(actual));
}
}