void (String filePath) { myFixture.configureByFile(filePath); int offset = myFixture.getEditor().getCaretModel().getOffset(); final PsiFile file = myFixture.getFile(); final ConvertParameterToMapEntryIntention intention = new ConvertParameterToMapEntryIntention(); PsiElement element = file.findElementAt(offset); while (element != null && !(element instanceof GrReferenceExpression || element instanceof GrParameter)) { element = element.getParent(); } Assert.assertNotNull(element); final PsiElementPredicate condition = intention.getElementPredicate(); Assert.assertTrue(condition.satisfiedBy(element)); // Launch it! intention.processIntention(element, myFixture.getProject(), myFixture.getEditor()); PostprocessReformattingAspect.getInstance(getProject()).doPostponedFormatting(); final String result = file.getText(); //System.out.println(result); myFixture.checkResultByFile(filePath.replace(".groovy", ".test"), true); // String expected = getExpectedResult(filePath); // Assert.assertEquals(expected, result); }