use of com.thoughtworks.go.plugin.domain.analytics.Capabilities in project gocd by gocd.
the class GoVelocityViewTest method shouldSetSupportsAnalyticsDashboardIfPluginInstalled.
@Test
public void shouldSetSupportsAnalyticsDashboardIfPluginInstalled() throws Exception {
List<SupportedAnalytics> supportedAnalytics = Collections.singletonList(new SupportedAnalytics("dashboard", "id", "foo"));
AnalyticsPluginInfo info = new AnalyticsPluginInfo(null, null, new Capabilities(supportedAnalytics), null);
when(pluginInfoFinder.allPluginInfos(ANALYTICS_EXTENSION)).thenReturn(Collections.singletonList(new CombinedPluginInfo(info)));
view.exposeHelpers(velocityContext, request);
assertThat(velocityContext.get(GoVelocityView.SUPPORTS_ANALYTICS_DASHBOARD), is(true));
}
use of com.thoughtworks.go.plugin.domain.analytics.Capabilities in project gocd by gocd.
the class AnalyticsPluginInfoBuilderTest method shouldBuildPluginInfoWithCapabilities.
@Test
public void shouldBuildPluginInfoWithCapabilities() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
Capabilities capabilities = new Capabilities(Collections.emptyList());
when(extension.getCapabilities(descriptor.id())).thenReturn(capabilities);
AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getCapabilities(), is(capabilities));
}
use of com.thoughtworks.go.plugin.domain.analytics.Capabilities in project gocd by gocd.
the class AnalyticsPluginInfoBuilder method pluginInfoFor.
public AnalyticsPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
Capabilities capabilities = capabilities(descriptor.id());
PluggableInstanceSettings pluginSettingsAndView = getPluginSettingsAndView(descriptor, extension);
Image image = image(descriptor.id());
return new AnalyticsPluginInfo(descriptor, image, capabilities, pluginSettingsAndView);
}
use of com.thoughtworks.go.plugin.domain.analytics.Capabilities in project gocd by gocd.
the class AnalyticsPluginInfoBuilderTest method setUp.
@Before
public void setUp() throws Exception {
extension = mock(AnalyticsExtension.class);
stub(extension.getCapabilities(any(String.class))).toReturn(new Capabilities(Collections.emptyList()));
}
use of com.thoughtworks.go.plugin.domain.analytics.Capabilities 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