mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
Execute restart, when there are only plugins to uninstall
This commit is contained in:
@@ -222,7 +222,7 @@ public class DefaultPluginManager implements PluginManager {
|
|||||||
@Override
|
@Override
|
||||||
public void executePendingAndRestart() {
|
public void executePendingAndRestart() {
|
||||||
PluginPermissions.manage().check();
|
PluginPermissions.manage().check();
|
||||||
if (!pendingQueue.isEmpty()) {
|
if (!pendingQueue.isEmpty() || getInstalled().stream().anyMatch(InstalledPlugin::isMarkedForUninstall)) {
|
||||||
restart("execute pending plugin changes");
|
restart("execute pending plugin changes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,6 +415,18 @@ class DefaultPluginManagerTest {
|
|||||||
|
|
||||||
verify(mailPlugin).setUninstallable(false);
|
verify(mailPlugin).setUninstallable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldRestartWithUninstallOnly() {
|
||||||
|
InstalledPlugin mailPlugin = createInstalled("scm-mail-plugin");
|
||||||
|
when(mailPlugin.isMarkedForUninstall()).thenReturn(true);
|
||||||
|
|
||||||
|
when(loader.getInstalledPlugins()).thenReturn(singletonList(mailPlugin));
|
||||||
|
|
||||||
|
manager.executePendingAndRestart();
|
||||||
|
|
||||||
|
verify(eventBus).post(any(RestartEvent.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
Reference in New Issue
Block a user