[java-inspections] Use latest mockJDK instead of mocking individual classes

GitOrigin-RevId: 5bdde04b83f4a66e373724bc40ea5d129467bf25
This commit is contained in:
Tagir Valeev
2024-06-25 16:42:40 +00:00
committed by intellij-monorepo-bot
parent 15bb3eb9f4
commit 2c31e99a77
2 changed files with 8 additions and 19 deletions
@@ -1,7 +1,9 @@
package com.siyeh.ig.bugs;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.LightJavaInspectionTestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class ClassNewInstanceInspectionTest extends LightJavaInspectionTestCase {
@@ -17,10 +19,7 @@ public class ClassNewInstanceInspectionTest extends LightJavaInspectionTestCase
}
@Override
protected String[] getEnvironmentClasses() {
return new String[] {
"package java.lang;" +
"public class InstantiationException extends Exception {}"
};
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_LATEST_WITH_LATEST_JDK;
}
}
@@ -2,7 +2,9 @@
package com.siyeh.ig.portability;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.testFramework.LightProjectDescriptor;
import com.siyeh.ig.LightJavaInspectionTestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -11,20 +13,8 @@ import org.jetbrains.annotations.Nullable;
public class HardcodedFileSeparatorsInspectionTest extends LightJavaInspectionTestCase {
@Override
protected String[] getEnvironmentClasses() {
return new String[] {
"package java.net;" +
"public final class URL implements java.io.Serializable { " +
"public URL(String spec) throws MalformedURLException { " +
" this(null, spec);" +
"}}",
"package java.net;" +
"public final class URI implements java.io.Serializable { " +
"public URI(String str) throws URISyntaxException { " +
" new Parser(str).parse(false);" +
"}}",
};
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
return JAVA_LATEST_WITH_LATEST_JDK;
}
public void testHardcodedFileSeparators() {