use of com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo in project gocd by gocd.
the class AnalyticsMetadataLoaderTest method onPluginUnloaded_shouldRemoveTheCorrespondingPluginInfoFromStore.
@Test
public void onPluginUnloaded_shouldRemoveTheCorrespondingPluginInfoFromStore() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
AnalyticsMetadataLoader metadataLoader = new AnalyticsMetadataLoader(pluginManager, metadataStore, infoBuilder, extension);
AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfo(descriptor, null, null, null);
metadataStore.setPluginInfo(pluginInfo);
metadataLoader.pluginUnLoaded(descriptor);
verify(metadataStore).remove(descriptor.id());
}
use of com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo in project gocd by gocd.
the class AnalyticsPluginInfoBuilderTest method shouldContinueBuildingPluginInfoIfPluginSettingsIsNotProvidedByPlugin.
@Test
public void shouldContinueBuildingPluginInfoIfPluginSettingsIsNotProvidedByPlugin() {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
doThrow(new RuntimeException("foo")).when(extension).getPluginSettingsConfiguration("plugin1");
AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getDescriptor(), is(descriptor));
assertThat(pluginInfo.getExtensionName(), is("analytics"));
assertNull(pluginInfo.getPluginSettings());
}
use of com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo in project gocd by gocd.
the class InitialContextProviderTest method analyticsPluginInfo.
private AnalyticsPluginInfo analyticsPluginInfo() {
AnalyticsPluginInfo analyticsPluginInfo = mock(AnalyticsPluginInfo.class);
Capabilities capabilities = mock(Capabilities.class);
when(capabilities.supportsDashboardAnalytics()).thenReturn(true);
when(analyticsPluginInfo.getCapabilities()).thenReturn(capabilities);
when(analyticsPluginInfo.getExtensionName()).thenReturn(PluginConstants.ANALYTICS_EXTENSION);
return analyticsPluginInfo;
}
Aggregations