Search in sources :

Example 11 with Capabilities

use of com.thoughtworks.go.plugin.domain.authorization.Capabilities in project gocd by gocd.

the class AuthPluginInfoViewModelTest method shouldGetDetailsAboutThePlugin.

@Test
public void shouldGetDetailsAboutThePlugin() {
    String pluginId = "github";
    GoPluginDescriptor.About about = GoPluginDescriptor.About.builder().name("GitHub Auth Plugin").version("1.0").build();
    GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id(pluginId).about(about).build();
    AuthorizationPluginInfo pluginInfo = new AuthorizationPluginInfo(descriptor, null, null, new Image("svg", "data", "hash"), new Capabilities(SupportedAuthType.Web, true, true, false));
    AuthPluginInfoViewModel model = new AuthPluginInfoViewModel(pluginInfo);
    assertThat(model.imageUrl(), is("/go/api/plugin_images/github/hash"));
    assertThat(model.pluginId(), is("github"));
    assertThat(model.name(), is("GitHub Auth Plugin"));
}
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) Test(org.junit.jupiter.api.Test)

Aggregations

Capabilities (com.thoughtworks.go.plugin.domain.authorization.Capabilities)11 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)10 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)6 Image (com.thoughtworks.go.plugin.domain.common.Image)3 Test (org.junit.jupiter.api.Test)3 PluginDescriptor (com.thoughtworks.go.plugin.api.info.PluginDescriptor)2 PluggableInstanceSettings (com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1