PersistenceUnitClassFinder { public void scanClasspath(Configuration configuration) { Objects.requireNonNull(configuration); if (!configuration.contains(JOPAPersistenceProperties.SCAN_PACKAGE)) { throw new IllegalArgumentException("Missing the " + JOPAPersistenceProperties.SCAN_PACKAGE + " property."); } String toScan = configuration.get(JOPAPersistenceProperties.SCAN_PACKAGE); if (toScan.isEmpty()) { throw new IllegalArgumentException(JOPAPersistenceProperties.SCAN_PACKAGE + " property cannot be empty."); } classProcessor.addListener(entityLoader); classProcessor.addListener(resultSetMappingLoader); classProcessor.processClasses(toScan); this.scanned = true; }  void scanClasspath(Configuration configuration); Set<Class<?>> getEntities(); Set<SparqlResultSetMapping> getResultSetMappings();  }
@Test public void throwsExceptionWhenScanPackageIsNotSupplied() { final Map<String, String> properties = Collections.emptyMap(); assertThrows(IllegalArgumentException.class, () -> finder.scanClasspath(new Configuration(properties))); }
@Test public void throwsExceptionWhenScanPackageIsEmpty() { final Map<String, String> properties = Collections.singletonMap(JOPAPersistenceProperties.SCAN_PACKAGE, ""); assertThrows(IllegalArgumentException.class, () -> finder.scanClasspath(new Configuration(properties))); }