SolverFileIndexer extends AbstractFileIndexer { @Override protected DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception { final org.uberfire.backend.vfs.Path vfsPath = Paths.convert(path); final KieModule module = kieModuleService.resolveModule(vfsPath); if (module == null) { logger.error("Unable to index " + path.toUri() + ", module could not be resolved."); return null; } final Package _package = kieModuleService.resolvePackage(vfsPath); if (_package == null) { logger.error("Unable to index " + path.toUri() + ", package could not be resolved."); return null; } return new DefaultIndexBuilder(vfsPath.getFileName(), module, _package); }  @Override boolean supportsPath(final Path path);  }
@Test public void fillIndexBuilder() throws Exception { Path path = PathFactory.newPath("SolverConfig.solver.xml", "default: when(moduleService.resolveModule(path)).thenReturn(mock(KieModule.class)); when(moduleService.resolvePackage(path)).thenReturn(mock(Package.class)); DefaultIndexBuilder indexBuilder = solverFileIndexer.fillIndexBuilder(Paths.convert(path)); assertNotNull(indexBuilder); }