@Test public void noPackageReturnsNull() throws Exception { final KieModule kieModule = mock(KieModule.class); doReturn(kieModule).when(moduleService).resolveModule(any(Path.class)); doReturn(null).when(moduleService).resolvePackage(any(Path.class)); assertNull(indexer.fillIndexBuilder(mainPath)); }
@Override protected IndexBuilder fillIndexBuilder(final Path path) throws Exception { final KieModule module = getModule(path); if (module == null) { logger.error("Unable to index {0}: module could not be resolved.", path.toUri().toString()); return null; } final Package pkg = getPackage(path); if (pkg == null) { logger.error("Unable to index {0}: package could not be resolved.", path.toUri().toString()); return null; } return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg); }
GitKeepFileIndexer extends AbstractFileIndexer { @Override protected IndexBuilder fillIndexBuilder(final Path path) throws Exception { final KieModule module = getModule(path); if (module == null) { logger.error("Unable to index {0}: module could not be resolved.", path.toUri().toString()); return null; } final Package pkg = getPackage(path); if (pkg == null) { logger.error("Unable to index {0}: package could not be resolved.", path.toUri().toString()); return null; } return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg); } }
GitKeepFileIndexer extends AbstractFileIndexer { @Override protected IndexBuilder fillIndexBuilder(final Path path) throws Exception { final KieModule module = getModule(path); if (module == null) { logger.error("Unable to index {0}: module could not be resolved.", path.toUri().toString()); return null; } final Package pkg = getPackage(path); if (pkg == null) { logger.error("Unable to index {0}: package could not be resolved.", path.toUri().toString()); return null; } return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg); }  }
GitKeepFileIndexer extends AbstractFileIndexer { @Override protected IndexBuilder fillIndexBuilder(final Path path) throws Exception { final KieModule module = getModule(path); if (module == null) { logger.error("Unable to index {0}: module could not be resolved.", path.toUri().toString()); return null; } final Package pkg = getPackage(path); if (pkg == null) { logger.error("Unable to index {0}: package could not be resolved.", path.toUri().toString()); return null; } return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg); }  @Override boolean supportsPath(final Path path); }
GitKeepFileIndexer extends AbstractFileIndexer { @Override protected IndexBuilder fillIndexBuilder(final Path path) throws Exception { final KieModule module = getModule(path); if (module == null) { logger.error("Unable to index {0}: module could not be resolved.", path.toUri().toString()); return null; } final Package pkg = getPackage(path); if (pkg == null) { logger.error("Unable to index {0}: package could not be resolved.", path.toUri().toString()); return null; } return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg); }  @Override boolean supportsPath(final Path path);  }