@Test
public void testEnablePlugin() throws Exception {

    // scenario with "enabled.txt"
    createEnabledFile();
    DefaultPluginStatusProvider statusProvider = new DefaultPluginStatusProvider(pluginsPath);
    statusProvider.enablePlugin("plugin-2");
    assertFalse(statusProvider.isPluginDisabled("plugin-1"));
    assertFalse(statusProvider.isPluginDisabled("plugin-2"));
    assertTrue(statusProvider.isPluginDisabled("plugin-3"));
    List<String> enabledPlugins = FileUtils.readLines(statusProvider.getEnabledFilePath(), true);
    assertTrue(enabledPlugins.contains("plugin-2"));
    assertTrue(Files.notExists(statusProvider.getDisabledFilePath()));
    // scenario with "disabled.txt"
    Files.delete(statusProvider.getEnabledFilePath());
    assertTrue(Files.notExists(statusProvider.getEnabledFilePath()));
    createDisabledFile();
    statusProvider = new DefaultPluginStatusProvider(pluginsPath);
    statusProvider.enablePlugin("plugin-2");
    assertFalse(statusProvider.isPluginDisabled("plugin-1"));
    assertFalse(statusProvider.isPluginDisabled("plugin-2"));
    List<String> disabledPlugins = FileUtils.readLines(statusProvider.getDisabledFilePath(), true);
    assertFalse(disabledPlugins.contains("plugin-2"));
}