Search in sources :

Example 6 with DataBoundConfigurator

use of io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator in project configuration-as-code-plugin by jenkinsci.

the class ExportTest method shouldNotExportValuesWithSecretGetters.

@Test
public void shouldNotExportValuesWithSecretGetters() throws Exception {
    DataBoundConfigurator<DataBoundSecret> c = new DataBoundConfigurator<>(DataBoundSecret.class);
    String res = export(c, new DataBoundSecret("test"));
    assertThat(res, not(containsString("test")));
}
Also used : DataBoundConfigurator(io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.Test)

Aggregations

DataBoundConfigurator (io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator)6 Test (org.junit.Test)5 Issue (org.jvnet.hudson.test.Issue)4 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 UsernamePasswordCredentialsImpl (com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl)1 ExtensionList (hudson.ExtensionList)1 Describable (hudson.model.Describable)1 Attribute (io.jenkins.plugins.casc.Attribute)1 AttributeTest (io.jenkins.plugins.casc.AttributeTest)1 Configurator (io.jenkins.plugins.casc.Configurator)1 RootElementConfigurator (io.jenkins.plugins.casc.RootElementConfigurator)1 ConfigurableConfigurator (io.jenkins.plugins.casc.impl.configurators.ConfigurableConfigurator)1 DescriptorConfigurator (io.jenkins.plugins.casc.impl.configurators.DescriptorConfigurator)1 EnumConfigurator (io.jenkins.plugins.casc.impl.configurators.EnumConfigurator)1 ExtensionConfigurator (io.jenkins.plugins.casc.impl.configurators.ExtensionConfigurator)1 HeteroDescribableConfigurator (io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator)1 PrimitiveConfigurator (io.jenkins.plugins.casc.impl.configurators.PrimitiveConfigurator)1 CNode (io.jenkins.plugins.casc.model.CNode)1 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1