rename PluginCenterEvent

This commit is contained in:
Eduard Heimbuch
2020-04-02 13:37:05 +02:00
parent 405bc392a8
commit b369fac1e8
3 changed files with 4 additions and 4 deletions

View File

@@ -27,4 +27,4 @@ package sonia.scm.plugin;
import sonia.scm.event.Event;
@Event
public class PluginCenterEvent {}
public class PluginCenterErrorEvent {}

View File

@@ -61,7 +61,7 @@ class PluginCenterLoader {
return mapper.map(pluginCenterDto);
} catch (Exception 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();
}
}

View File

@@ -79,11 +79,11 @@ class PluginCenterLoaderTest {
}
@Test
void shouldThrowExceptionAndFirePluginCenterNotAvailableEvent() throws IOException {
void shouldFirePluginCenterErrorEvent() throws IOException {
when(client.get(PLUGIN_URL).request()).thenThrow(new IOException("failed to fetch"));
loader.load(PLUGIN_URL);
verify(eventBus).post(any(PluginCenterEvent.class));
verify(eventBus).post(any(PluginCenterErrorEvent.class));
}
}