void () { VirtualFile virtualFile = findVirtualFile(BASE_PATH + "/Win1251.txt"); virtualFile.setCharset(StandardCharsets.UTF_8); configureByExistingFile(virtualFile); Document document = Objects.requireNonNull(FileDocumentManager.getInstance().getDocument(virtualFile)); assertFalse(FileDocumentManager.getInstance().isDocumentUnsaved(document)); assertEquals(StandardCharsets.UTF_8, virtualFile.getCharset()); doHighlighting(); List<HighlightInfo> infos = ((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzerEx.getInstanceEx(getProject())).getFileLevelHighlights(getProject(), getFile()); HighlightInfo info = assertOneElement(infos); assertEquals("The file was loaded in a wrong encoding: 'UTF-8'", info.getDescription()); }