Search in sources :

Example 1 with PackageParametersNonNullCheckForNull

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

the class DataBoundConfiguratorTest method packageParametersAreNonnullByDefaultButCanBeNullable.

@Test
@Issue("#1025")
public void packageParametersAreNonnullByDefaultButCanBeNullable() throws Exception {
    Mapping config = new Mapping();
    ConfiguratorRegistry registry = ConfiguratorRegistry.get();
    final PackageParametersNonNullCheckForNull configured = (PackageParametersNonNullCheckForNull) registry.lookupOrFail(PackageParametersNonNullCheckForNull.class).configure(config, new ConfigurationContext(registry));
    assertNull(configured.getSecret());
}
Also used : ConfiguratorRegistry(io.jenkins.plugins.casc.ConfiguratorRegistry) ConfigurationContext(io.jenkins.plugins.casc.ConfigurationContext) Mapping(io.jenkins.plugins.casc.model.Mapping) PackageParametersNonNullCheckForNull(io.jenkins.plugins.casc.impl.configurators.nonnull.nonnullparampackage.PackageParametersNonNullCheckForNull) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

ConfigurationContext (io.jenkins.plugins.casc.ConfigurationContext)1 ConfiguratorRegistry (io.jenkins.plugins.casc.ConfiguratorRegistry)1 PackageParametersNonNullCheckForNull (io.jenkins.plugins.casc.impl.configurators.nonnull.nonnullparampackage.PackageParametersNonNullCheckForNull)1 Mapping (io.jenkins.plugins.casc.model.Mapping)1 Test (org.junit.Test)1 Issue (org.jvnet.hudson.test.Issue)1