void () { TestApplicationManager.getInstance(); discovery = new ConfigDiscovery() { @Override protected FileBasedIndex getFileBasedIndex() { return fileBasedIndex; } @Override protected @NotNull Collection<String> discoverPropertyWithCache(@NotNull ConfigKey configKey, @NotNull PsiFile psiFile) { return super.discoverProperty(configKey, psiFile); } }; when(psiFile.getProject()).thenReturn(project); when(psiClass.getContainingFile()).thenReturn(psiFile); when(psiFile.getOriginalFile()).thenReturn(psiFile); when(psiFile.getVirtualFile()).thenReturn(virtualFile); when(virtualFile.getParent()).thenReturn(parentVirtualFile); when(parentVirtualFile.getParent()).thenReturn(parentParVirtualFile); when(parentParVirtualFile.getParent()).thenReturn(parentParParVirtualFile); when(parentParParVirtualFile.getParent()).thenReturn(parentParParParVirtualFile); }