EntityRepositoryScanner { public static void scan() throws InstantiationException, IllegalAccessException { LOG.info("Scanning all entity repositories with pattern \"eagle.*\""); final ComponentScanner scanner = new ComponentScanner(); final Set<Class<?>> classes = scanner.getClasses(new EntityRepoScanQuery() ); for (Class<?> entityClass : classes) { LOG.info("Processing entity repository: " + entityClass.getName()); if (EntityRepository.class.isAssignableFrom(entityClass)) { EntityRepository repo = (EntityRepository)entityClass.newInstance(); addRepo(repo); } } }  static void scan();  }
@Test public void testScan() throws InstantiationException, IllegalAccessException { EntityRepositoryScanner.scan(); Assert.assertNotNull(EntityDefinitionManager.getEntityByServiceName("MetricMetadataService")); }