mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
rename PluginCenterEvent
This commit is contained in:
@@ -27,4 +27,4 @@ package sonia.scm.plugin;
|
|||||||
import sonia.scm.event.Event;
|
import sonia.scm.event.Event;
|
||||||
|
|
||||||
@Event
|
@Event
|
||||||
public class PluginCenterEvent {}
|
public class PluginCenterErrorEvent {}
|
||||||
@@ -61,7 +61,7 @@ class PluginCenterLoader {
|
|||||||
return mapper.map(pluginCenterDto);
|
return mapper.map(pluginCenterDto);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.error("failed to load plugins from plugin center, returning empty list", ex);
|
LOG.error("failed to load plugins from plugin center, returning empty list", ex);
|
||||||
eventBus.post(new PluginCenterEvent());
|
eventBus.post(new PluginCenterErrorEvent());
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ class PluginCenterLoaderTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldThrowExceptionAndFirePluginCenterNotAvailableEvent() throws IOException {
|
void shouldFirePluginCenterErrorEvent() throws IOException {
|
||||||
when(client.get(PLUGIN_URL).request()).thenThrow(new IOException("failed to fetch"));
|
when(client.get(PLUGIN_URL).request()).thenThrow(new IOException("failed to fetch"));
|
||||||
|
|
||||||
loader.load(PLUGIN_URL);
|
loader.load(PLUGIN_URL);
|
||||||
|
|
||||||
verify(eventBus).post(any(PluginCenterEvent.class));
|
verify(eventBus).post(any(PluginCenterErrorEvent.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user