void (JavaFileType fileType, String search, String name, String replacement) { final Configuration configuration = replacement == null ? new SearchConfiguration() : new ReplaceConfiguration(); configuration.setName(name); final MatchOptions matchOptions = configuration.getMatchOptions(); matchOptions.setFileType(fileType); matchOptions.fillSearchCriteria(search); if (replacement != null) { configuration.getReplaceOptions().setReplacement(replacement); } StructuralSearchProfileActionProvider.createNewInspection(configuration, myFixture.getProject()); myFixture.testHighlighting(true, false, false, getTestName(false) + getExtension()); if (replacement != null) { final IntentionAction intention = myFixture.getAvailableIntention(CommonQuickFixBundle.message("fix.replace.with.x", replacement)); assertNotNull(intention); myFixture.checkPreviewAndLaunchAction(intention); myFixture.checkResultByFile(getTestName(false) + ".after" + getExtension()); } }