use of com.thoughtworks.go.plugin.domain.common.Image in project gocd by gocd.
the class ElasticAgentExtensionV2Test method shouldGetPluginIcon.
@Test
public void shouldGetPluginIcon() throws JSONException {
when(pluginManager.submitTo(eq(PLUGIN_ID), eq(ELASTIC_AGENT_EXTENSION), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success("{\"content_type\":\"image/png\",\"data\":\"Zm9vYmEK\"}"));
final Image icon = extensionV2.getIcon(PLUGIN_ID);
assertThat(icon.getContentType(), is("image/png"));
assertThat(icon.getData(), is("Zm9vYmEK"));
assertExtensionRequest("2.0", REQUEST_GET_PLUGIN_SETTINGS_ICON, null);
}
use of com.thoughtworks.go.plugin.domain.common.Image in project gocd by gocd.
the class ElasticAgentExtensionV3Test method shouldGetPluginIcon.
@Test
public void shouldGetPluginIcon() throws JSONException {
when(pluginManager.submitTo(eq(PLUGIN_ID), eq(ELASTIC_AGENT_EXTENSION), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success("{\"content_type\":\"image/png\",\"data\":\"Zm9vYmEK\"}"));
final Image icon = extensionV3.getIcon(PLUGIN_ID);
assertThat(icon.getContentType(), is("image/png"));
assertThat(icon.getData(), is("Zm9vYmEK"));
assertExtensionRequest("3.0", REQUEST_GET_PLUGIN_SETTINGS_ICON, null);
}
use of com.thoughtworks.go.plugin.domain.common.Image 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.common.Image in project gocd by gocd.
the class SecurityAuthConfigServiceTest method pluginInfo.
private AuthorizationPluginInfo pluginInfo(String githubPluginId, String name, SupportedAuthType supportedAuthType) {
GoPluginDescriptor.About about = new GoPluginDescriptor.About(name, "1.0", null, null, null, null);
GoPluginDescriptor descriptor = new GoPluginDescriptor(githubPluginId, "1.0", about, null, null, false);
return new AuthorizationPluginInfo(descriptor, null, null, new Image("svg", "data", "hash"), new Capabilities(supportedAuthType, true, true));
}
use of com.thoughtworks.go.plugin.domain.common.Image in project gocd by gocd.
the class ElasticAgentExtensionV1Test method shouldGetPluginIcon.
@Test
public void shouldGetPluginIcon() throws JSONException {
when(pluginManager.submitTo(eq(PLUGIN_ID), eq(ELASTIC_AGENT_EXTENSION), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success("{\"content_type\":\"image/png\",\"data\":\"Zm9vYmEK\"}"));
final Image icon = extensionV1.getIcon(PLUGIN_ID);
assertThat(icon.getContentType(), is("image/png"));
assertThat(icon.getData(), is("Zm9vYmEK"));
assertExtensionRequest("1.0", REQUEST_GET_PLUGIN_SETTINGS_ICON, null);
}
Aggregations