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"));
}
Aggregations