I have a test for my plugin, based on LightJavaCodeInsightFixtureTestCase.
I set it up using
PsiFile psiFiles = myFixture.configureByFiles("module/src/main/java/TestObject.java", "pom.xml");
And later on I search for the Jar file (It's in the library list for the real project, but in the test - it looks like it is not in the library list) like that:
VirtualFile extFolder = FilenameIndex.getVirtualFilesByName(project, "ext", GlobalSearchScope.projectScope(project)).stream().findAny().orElse(null);
VirtualFile fileJarContent = extFolder.findFileByRelativePath("libs/1.1.1/jars/content-file-1.1.1.jar");
VirtualFile jarRootForLocalFile = JarFileSystem.getInstance().getJarRootForLocalFile(fileJarContent);
When plugin runs in the real IDE - jarRootForLocalFile is resolved and I can later use the function:
However in the plugin test - it is not resolved and returns null.
How to let JarFileSystem aware of this file and enforce it to resolve the file as JAR file, parsing it's content?