@Test void testActivateApp() { when(dataService.findOneById(AppMetadata.APP, "test", App.class)).thenReturn(app); app.setActive(true); Plugin plugin = mock(Plugin.class); when(pluginFactory.create(APP_PREFIX + "app1")).thenReturn(plugin); plugin.setLabel("label"); plugin.setDescription("description"); appManagerServiceImpl.activateApp(app); verify(dataService).add("sys_Plugin", plugin); }
@Override @Transactional public void activateApp(App app) { String pluginId = generatePluginId(app); Plugin plugin = pluginFactory.create(pluginId); plugin.setLabel(app.getLabel()); plugin.setPath(APP_PLUGIN_ROOT + app.getName()); plugin.setDescription(app.getDescription()); dataService.add(PluginMetadata.PLUGIN, plugin); }
AppManagerServiceImpl implements AppManagerService { @Override @Transactional public void activateApp(App app) { String pluginId = generatePluginId(app); Plugin plugin = pluginFactory.create(pluginId); plugin.setLabel(app.getLabel()); plugin.setPath(APP_PLUGIN_ROOT + app.getName()); plugin.setDescription(app.getDescription()); dataService.add(PluginMetadata.PLUGIN, plugin); } }
AppManagerServiceImpl implements AppManagerService { @Override @Transactional public void activateApp(App app) { String pluginId = generatePluginId(app); Plugin plugin = pluginFactory.create(pluginId); plugin.setLabel(app.getLabel()); plugin.setPath(APP_PLUGIN_ROOT + app.getName()); plugin.setDescription(app.getDescription()); dataService.add(PluginMetadata.PLUGIN, plugin); } AppManagerServiceImpl(
      AppFactory appFactory,
      DataService dataService,
      FileStore fileStore,
      Gson gson,
      PluginFactory pluginFactory); }
AppManagerServiceImpl implements AppManagerService { @Override @Transactional public void activateApp(App app) { String pluginId = generatePluginId(app); Plugin plugin = pluginFactory.create(pluginId); plugin.setLabel(app.getLabel()); plugin.setPath(APP_PLUGIN_ROOT + app.getName()); plugin.setDescription(app.getDescription()); dataService.add(PluginMetadata.PLUGIN, plugin); } AppManagerServiceImpl(
      AppFactory appFactory,
      DataService dataService,
      FileStore fileStore,
      Gson gson,
      PluginFactory pluginFactory); @Override List<AppResponse> getApps(); @Override AppResponse getAppByName(String appName); @Override @Transactional void activateApp(App app); @Override @Transactional void deactivateApp(App app); @Override @Transactional void deleteApp(String id); @Override String uploadApp(InputStream zipData, String zipFileName, String formFieldName); @Override AppConfig checkAndObtainConfig(String tempDir, String configContent); @Override @Transactional void configureApp(AppConfig appConfig, String htmlTemplate); @Override String extractFileContent(String appDir, String fileName); }
AppManagerServiceImpl implements AppManagerService { @Override @Transactional public void activateApp(App app) { String pluginId = generatePluginId(app); Plugin plugin = pluginFactory.create(pluginId); plugin.setLabel(app.getLabel()); plugin.setPath(APP_PLUGIN_ROOT + app.getName()); plugin.setDescription(app.getDescription()); dataService.add(PluginMetadata.PLUGIN, plugin); } AppManagerServiceImpl(
      AppFactory appFactory,
      DataService dataService,
      FileStore fileStore,
      Gson gson,
      PluginFactory pluginFactory); @Override List<AppResponse> getApps(); @Override AppResponse getAppByName(String appName); @Override @Transactional void activateApp(App app); @Override @Transactional void deactivateApp(App app); @Override @Transactional void deleteApp(String id); @Override String uploadApp(InputStream zipData, String zipFileName, String formFieldName); @Override AppConfig checkAndObtainConfig(String tempDir, String configContent); @Override @Transactional void configureApp(AppConfig appConfig, String htmlTemplate); @Override String extractFileContent(String appDir, String fileName); static final String APPS_DIR; static final String ZIP_INDEX_FILE; static final String ZIP_CONFIG_FILE; static final String APP_PLUGIN_ROOT; }