LoadHubModulesCommand extends AbstractCommand { @Override public void execute(CommandContext context) { String timestampFile = hubConfig.getHubProject().getHubModulesDeployTimestampFile(); PropertiesModuleManager propsManager = new PropertiesModuleManager(timestampFile); propsManager.deletePropertiesFile(); DatabaseClient modulesClient = hubConfig.newModulesDbClient(); AssetFileLoader assetFileLoader = new AssetFileLoader(modulesClient); prepareAssetFileLoader(assetFileLoader, context); DefaultModulesLoader modulesLoader = new DefaultModulesLoader(assetFileLoader); modulesLoader.addFailureListener((throwable, client) -> { if (caughtException == null) { caughtException = throwable; } }); modulesLoader.setModulesManager(propsManager); if (caughtException == null) { modulesLoader.loadModules("classpath*:/ml-modules", new DefaultModulesFinder(), modulesClient); modulesLoader.loadModules("classpath*:/ml-modules-staging", new SearchOptionsFinder(), hubConfig.newStagingClient()); } if (caughtException == null) { modulesLoader.loadModules("classpath*:/ml-modules-traces", new SearchOptionsFinder(), hubConfig.newJobDbClient()); } if (caughtException == null) { modulesLoader.loadModules("classpath*:/ml-modules-jobs", new SearchOptionsFinder(), hubConfig.newJobDbClient()); } if (caughtException != null) { throw new RuntimeException(caughtException); } } LoadHubModulesCommand();  LoadHubModulesCommand(HubConfig hubConfig); @Override void execute(CommandContext context); void setHubConfig(HubConfig hubConfig);  }
@Test public void ensureHubFourLoaded() { loadHubModulesCommand.execute(commandContext); String jarVersion = adminHubConfig.getJarVersion(); assertTrue(jarVersion.charAt(0) >= '4'); assertEquals(jarVersion, versions.getHubVersion(), "Jar version must match version in config.xqy/config.sjs after installation"); }