diff --git a/src/test/java/de/plushnikov/intellij/plugin/ExtensionMethodTest.java b/src/test/java/de/plushnikov/intellij/plugin/ExtensionMethodTest.java index 8cce47bd7..9f9f00e65 100644 --- a/src/test/java/de/plushnikov/intellij/plugin/ExtensionMethodTest.java +++ b/src/test/java/de/plushnikov/intellij/plugin/ExtensionMethodTest.java @@ -8,6 +8,7 @@ import com.intellij.testFramework.LightJavaCodeInsightTestCase; import com.intellij.testFramework.LightProjectDescriptor; +import de.plushnikov.intellij.plugin.settings.ProjectSettings; import junit.framework.AssertionFailedError; import org.jetbrains.annotations.NotNull; @@ -40,12 +41,18 @@ private void checkMethod(final PsiMethod method, final boolean successful) { private PsiMethod createTestMethod(final String body) { return PsiTreeUtil.findChildOfType(createTestFile("static void f() {" + body + "}"), PsiMethod.class); } private PsiFile createTestFile(final String body) { + enableExtensionMethodSupport(); + return createFile("test.java", "import java.util.*; import java.util.function.*;" + "@lombok.experimental.ExtensionMethod({" + "Objects.class, Arrays.class" + "}) class TestExtensionMethod { " + body + "}"); } + private void enableExtensionMethodSupport() { + ProjectSettings.setEnabled(getProject(), ProjectSettings.IS_EXTENSION_METHOD_ENABLED, true); + } + @NotNull @Override protected LightProjectDescriptor getProjectDescriptor() { return LombokTestUtil.getProjectDescriptor(); }