void () { myFixture.addClass("package org.junit.jupiter.api;" + "@org.junit.platform.commons.annotation.Testable public @interface Test {}"); myFixture.addClass("package org.junit.jupiter.api;" + "@org.junit.platform.commons.annotation.Testable public @interface Disabled {}"); PsiFile file = myFixture.configureByText("TestableClassTest.java", """ class TestableClassTest { \n\t@org.junit.jupiter.api.Test \n\tvoid foo() {} \n\tvoid foo1() {} \n\t@org.junit.jupiter.api.Test \n\t@org.junit.jupiter.api.Disabled \n\tvoid foo2() {} }"""); PsiClass aClass = ((PsiClassOwner)file).getClasses()[0]; assertTrue(JUnitUtil.isTestClass(aClass)); TestFramework framework = TestFrameworks.detectFramework(aClass); PsiMethod fooMethod = aClass.getMethods()[0]; PsiMethod foo1Method = aClass.getMethods()[1]; PsiMethod foo2Method = aClass.getMethods()[2]; assertTrue(JUnitUtil.isTestMethod(PsiLocation.fromPsiElement(fooMethod))); assertFalse(JUnitUtil.isTestMethod(PsiLocation.fromPsiElement(foo1Method))); assertTrue(JUnitUtil.isTestMethod(PsiLocation.fromPsiElement(foo2Method))); assertFalse(framework.isIgnoredMethod(fooMethod)); assertFalse(framework.isIgnoredMethod(foo1Method)); assertTrue(framework.isIgnoredMethod(foo2Method)); TestIconProvider provider = new TestIconProvider(); LayeredIcon fooMethodIcon = (LayeredIcon) provider.getIcon(fooMethod, 0); assertEquals("Method", fooMethodIcon.getIcon(0).toString()); assertEquals("runConfigurations/testMark.svg", fooMethodIcon.getIcon(1).toString()); assertEquals("nodes/c_public.svg", fooMethodIcon.getIcon(2).toString()); Icon foo1MethodIcon = provider.getIcon(foo1Method, 0); assertNull(foo1MethodIcon); LayeredIcon foo2MethodIcon = (LayeredIcon)provider.getIcon(foo2Method, 0); assertEquals("runConfigurations/ignoredTest.svg", foo2MethodIcon.getIcon(0).toString()); assertEquals("nodes/c_public.svg", foo2MethodIcon.getIcon(1).toString()); }