use of com.thoughtworks.go.plugin.domain.common.PluginConfiguration in project gocd by gocd.
the class PluginProfileMetadataKeysTest method shouldGetPluginConfigurationsWithMetadataDefaultedToFalseInAbsenceOfPluginMetadata.
@Test
public void shouldGetPluginConfigurationsWithMetadataDefaultedToFalseInAbsenceOfPluginMetadata() throws Exception {
PluginProfileMetadataKeys metadata = PluginProfileMetadataKeys.fromJSON("[{\n" + " \"key\": \"username\"\n" + "}, {\n" + " \"key\": \"password\",\n" + " \"metadata\": {\n" + " \"secure\": true,\n" + " \"required\": true\n" + " }\n" + "}]");
List<PluginConfiguration> pluginConfigurations = metadata.toPluginConfigurations();
assertThat(pluginConfigurations, containsInAnyOrder(new PluginConfiguration("username", new Metadata(false, false)), new PluginConfiguration("password", new Metadata(true, true))));
}
use of com.thoughtworks.go.plugin.domain.common.PluginConfiguration in project gocd by gocd.
the class PluginProfileMetadataKeysTest method shouldGetPluginConfigurations.
@Test
public void shouldGetPluginConfigurations() throws Exception {
PluginProfileMetadataKeys metadata = PluginProfileMetadataKeys.fromJSON("[{\n" + " \"key\": \"username\",\n" + " \"metadata\": {\n" + " \"secure\": true,\n" + " \"required\": false\n" + " }\n" + "}, {\n" + " \"key\": \"password\",\n" + " \"metadata\": {\n" + " \"secure\": true,\n" + " \"required\": true\n" + " }\n" + "}]");
List<PluginConfiguration> pluginConfigurations = metadata.toPluginConfigurations();
assertThat(pluginConfigurations, containsInAnyOrder(new PluginConfiguration("username", new Metadata(false, true)), new PluginConfiguration("password", new Metadata(true, true))));
}
use of com.thoughtworks.go.plugin.domain.common.PluginConfiguration in project gocd by gocd.
the class ElasticAgentPluginInfoBuilder method elasticProfileSettings.
private PluggableInstanceSettings elasticProfileSettings(String pluginId) {
List<PluginConfiguration> profileMetadata = extension.getProfileMetadata(pluginId);
String profileView = extension.getProfileView(pluginId);
return new PluggableInstanceSettings(profileMetadata, new PluginView(profileView));
}
Aggregations