mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-31 03:39:14 +01:00
PluginInstaller returns now PendingPluginInstallation, to abort the installation before restart
This commit is contained in:
@@ -51,6 +51,17 @@ class PluginInstallerTest {
|
||||
assertThat(directory.resolve("plugins").resolve("scm-git-plugin.smp")).hasContent("42");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnPendingPluginInstallation() throws IOException {
|
||||
mockContent("42");
|
||||
AvailablePlugin gitPlugin = createGitPlugin();
|
||||
|
||||
PendingPluginInstallation pending = installer.install(gitPlugin);
|
||||
|
||||
assertThat(pending).isNotNull();
|
||||
assertThat(pending.getPlugin()).isSameAs(gitPlugin);
|
||||
}
|
||||
|
||||
private void mockContent(String content) throws IOException {
|
||||
when(client.get("https://download.hitchhiker.com").request().contentAsStream())
|
||||
.thenReturn(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)));
|
||||
|
||||
Reference in New Issue
Block a user