Search in sources :

Example 1 with Image

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);
}
Also used : Image(com.thoughtworks.go.plugin.domain.common.Image) Test(org.junit.Test)

Example 2 with Image

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);
}
Also used : Image(com.thoughtworks.go.plugin.domain.common.Image) Test(org.junit.Test)

Example 3 with Image

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);
}
Also used : AnalyticsPluginInfo(com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo) PluggableInstanceSettings(com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings) Capabilities(com.thoughtworks.go.plugin.domain.analytics.Capabilities) Image(com.thoughtworks.go.plugin.domain.common.Image)

Example 4 with Image

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));
}
Also used : Capabilities(com.thoughtworks.go.plugin.domain.authorization.Capabilities) AuthorizationPluginInfo(com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) Image(com.thoughtworks.go.plugin.domain.common.Image)

Example 5 with Image

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);
}
Also used : Image(com.thoughtworks.go.plugin.domain.common.Image) Test(org.junit.Test)

Aggregations

Image (com.thoughtworks.go.plugin.domain.common.Image)8 Test (org.junit.Test)4 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)3 Capabilities (com.thoughtworks.go.plugin.domain.authorization.Capabilities)3 PluggableInstanceSettings (com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings)2 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)2 AnalyticsPluginInfo (com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo)1 Capabilities (com.thoughtworks.go.plugin.domain.analytics.Capabilities)1 CombinedPluginInfo (com.thoughtworks.go.plugin.domain.common.CombinedPluginInfo)1