void () { myFixture.configureByText("Test.java", """ public class Test {} <error descr="Class 'Another' is public, should be declared in a file named 'Another.java'">public class <caret>Another</error> {}"""); myFixture.checkHighlighting(); IntentionAction action = myFixture.findSingleIntention("Move class 'Another' to 'Another.java'"); myFixture.checkIntentionPreviewHtml(action, """ <p><icon src="source_Another"/>&nbsp;Another &rarr; <icon src="target_src"/>&nbsp;src</p>"""); myFixture.launchAction(action); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); myFixture.checkResult("public class Test {}\n"); PsiClass another = myFixture.findClass("Another"); assertNotNull(another); PsiFile file = another.getContainingFile(); assertEquals("Another.java", file.getName()); assertEquals("public class Another {}\n", file.getText()); }