@Test
    void exportYaml() throws Exception {
        Foo foo = new Foo("foo", true, 42);
        foo.setZot("zot");
        foo.setDbl(12.34);
        foo.setFlt(1f); // whole numbers are exported as "<number>.0"
        ConfiguratorRegistry registry = ConfiguratorRegistry.get();
        final Configurator c = registry.lookupOrFail(Foo.class);
        final ConfigurationContext context = new ConfigurationContext(registry);
        final CNode node = c.describe(foo, context);
        assertNotNull(node);
        assertInstanceOf(Mapping.class, node);
        Mapping map = (Mapping) node;
        assertEquals("foo", map.get("foo").toString());
        assertEquals("true", map.get("bar").toString());
        assertEquals("42", map.get("qix").toString());
        assertEquals("zot", map.get("zot").toString());
        assertEquals("12.34", map.get("dbl").toString());
        assertEquals("1.0", map.get("flt").toString());
        assertEquals("\"foo\"", Util.toYamlString(map.get("foo")).trim());
        assertEquals("true", Util.toYamlString(map.get("bar")).trim());
        assertEquals("42", Util.toYamlString(map.get("qix")).trim());
        assertEquals("\"zot\"", Util.toYamlString(map.get("zot")).trim());
        assertEquals("\"12.34\"", Util.toYamlString(map.get("dbl")).trim());
        assertEquals("\"1.0\"", Util.toYamlString(map.get("flt")).trim());
        assertFalse(map.containsKey("other"));
    }
@author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
test-harness/src/test/java/io/jenkins/plugins/casc/impl/configurators/DataBoundConfiguratorTest.java