YamlEngine { public static String marshal(final Object value) { return new Yaml(new ElasticJobYamlRepresenter()).dumpAsMap(value); }  static String marshal(final Object value); static T unmarshal(final String yamlContent, final Class<T> classType); static T unmarshal(final String prefix, final InputStream configFileInput, final Class<T> classType);  }
@Test public void assertMarshal() { FooYamlConfiguration actual = new FooYamlConfiguration(); actual.setFoo("foo"); actual.setBar("bar"); FooYamlConfiguration nest = new FooYamlConfiguration(); nest.setFoo("nest_foo"); nest.setBar("nest_bar"); actual.setNest(nest); assertThat(YamlEngine.marshal(actual), is(YAML)); }
@Test public void assertMarshalWithNullValue() { FooYamlConfiguration actual = new FooYamlConfiguration(); actual.setFoo("foo"); assertThat(YamlEngine.marshal(actual), is(YAML_WITH_NULL)); }