use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor 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.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.
the class AnalyticsPluginInfoBuilderTest method shouldBuildPluginInfoWithPluginDescriptor.
@Test
public void shouldBuildPluginInfoWithPluginDescriptor() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getDescriptor(), is(descriptor));
}
use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.
the class AnalyticsPluginInfoBuilderTest method shouldBuildPluginInfoWithImage.
@Test
public void shouldBuildPluginInfoWithImage() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
Image icon = new Image("content_type", "data", "hash");
when(extension.getIcon(descriptor.id())).thenReturn(icon);
AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getImage(), is(icon));
}
use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.
the class ArtifactPluginInfoBuilderTest method shouldBuildPluginInfoWithFetchArtifactConfigSettings.
@Test
public void shouldBuildPluginInfoWithFetchArtifactConfigSettings() {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
List<PluginConfiguration> pluginConfigurations = Arrays.asList(new PluginConfiguration("FILENAME", new Metadata(true, false)));
when(extension.getFetchArtifactMetadata(descriptor.id())).thenReturn(pluginConfigurations);
when(extension.getFetchArtifactView(descriptor.id())).thenReturn("fetch_artifact_view");
ArtifactPluginInfo pluginInfo = new ArtifactPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getFetchArtifactSettings(), Is.is(new PluggableInstanceSettings(pluginConfigurations, new PluginView("fetch_artifact_view"))));
}
use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.
the class ArtifactPluginInfoBuilderTest method shouldContinueWithBuildingPluginInfoIfPluginSettingsIsNotProvidedByPlugin.
@Test
public void shouldContinueWithBuildingPluginInfoIfPluginSettingsIsNotProvidedByPlugin() {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
doThrow(new RuntimeException("foo")).when(extension).getPluginSettingsConfiguration("plugin1");
ArtifactPluginInfo artifactPluginInfo = new ArtifactPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(artifactPluginInfo.getDescriptor(), is(descriptor));
assertThat(artifactPluginInfo.getExtensionName(), is(PluginConstants.ARTIFACT_EXTENSION));
}
Aggregations