Search in sources :

Example 21 with PluginConfiguration

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

Example 22 with PluginConfiguration

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

Example 23 with PluginConfiguration

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));
}
Also used : PluggableInstanceSettings(com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings) PluginConfiguration(com.thoughtworks.go.plugin.domain.common.PluginConfiguration) PluginView(com.thoughtworks.go.plugin.domain.common.PluginView)

Aggregations

PluginConfiguration (com.thoughtworks.go.plugin.domain.common.PluginConfiguration)23 Metadata (com.thoughtworks.go.plugin.domain.common.Metadata)21 Test (org.junit.Test)21 PluggableInstanceSettings (com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings)12 ConfigurationProperty (com.thoughtworks.go.domain.config.ConfigurationProperty)8 ConfigurationKey (com.thoughtworks.go.domain.config.ConfigurationKey)7 ConfigurationValue (com.thoughtworks.go.domain.config.ConfigurationValue)7 EncryptedConfigurationValue (com.thoughtworks.go.domain.config.EncryptedConfigurationValue)6 AgentMetadata (com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata)4 PluginView (com.thoughtworks.go.plugin.domain.common.PluginView)4 GoPluginApiRequest (com.thoughtworks.go.plugin.api.request.GoPluginApiRequest)3 ConfigRepoPluginInfo (com.thoughtworks.go.plugin.domain.configrepo.ConfigRepoPluginInfo)3 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)3 DefaultGoPluginApiResponse (com.thoughtworks.go.plugin.api.response.DefaultGoPluginApiResponse)2 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)2 ElasticAgentPluginInfo (com.thoughtworks.go.plugin.domain.elastic.ElasticAgentPluginInfo)2 GoCipher (com.thoughtworks.go.security.GoCipher)2 ConfigurationPropertyBuilder (com.thoughtworks.go.config.builder.ConfigurationPropertyBuilder)1 PluginSettingsConfiguration (com.thoughtworks.go.plugin.access.common.settings.PluginSettingsConfiguration)1 ArtifactPluginInfo (com.thoughtworks.go.plugin.domain.artifact.ArtifactPluginInfo)1