void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); MyDomElementsInspection inspection = new MyDomElementsInspection() { @Override public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; } @Override public void checkFileElement(final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { } }; registerInspectionKey(inspection); LocalInspectionToolWrapper toolWrapper = new LocalInspectionToolWrapper(inspection); myInspectionProfile.setInspectionTools(Collections.singletonList(toolWrapper)); myInspectionProfile.setEnabled(toolWrapper, false); myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.getInspection()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }