void () { myFixture.configureByFile("com/example/package.html"); myFixture.testHighlighting(true, false, false); IntentionAction action = myFixture.findSingleIntention("Convert to 'package-info.java'"); PsiFile psiFile = myFixture.getFile(); PsiDirectory directory = psiFile.getContainingDirectory(); assertTrue(psiFile.isValid()); myFixture.launchAction(action); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); assertFalse(psiFile.isValid()); PsiFile packageInfo = directory.findFile("package-info.java"); assertNotNull(packageInfo); assertEquals(""" /** * Hello from documentation! * <p> * This is a package. * </p> */ package com.example;""", packageInfo.getText()); }