void () { final String filePath = getBeforeFile(myFileSuffix); configureByFile(filePath); final File testDir = new File(getTestDataPath(), filePath).getParentFile(); final String afterName = getAfterFile(myFileSuffix); final boolean conflictShouldBeFound = !new File(testDir, afterName).exists(); try { perform(); if (conflictShouldBeFound) { fail("Conflict expected."); } } catch (BaseRefactoringProcessor.ConflictsInTestsException exception) { if (!conflictShouldBeFound) { fail("Conflict not expected"); } else { final File conflicts = new File(testDir, FileUtilRt.getNameWithoutExtension(myFileSuffix) + CONFLICTS_SUFFIX); if (!conflicts.exists()) { fail("Conflict file " + conflicts.getPath() + " not found"); } final VirtualFile conflictsFile = VfsUtil.findFileByIoFile(conflicts, false); assertNotNull(conflictsFile); assertEquals(LoadTextUtil.loadText(conflictsFile).toString(), exception.getMessage()); } } if (!conflictShouldBeFound) { checkResultByFile(getAfterFile(myFileSuffix)); } }