### Question:
YamlStore implements ConfigurationStore { public YamlStore addResource(Resource resource, String key, String... tags) { List<String> tagList = new ArrayList<String>(); addAll(tagList, tags); return new YamlStore(this, key, new TaggedResource(resource, tagList)); } YamlStore(); private  YamlStore(YamlStore old, String key, TaggedResource resource); YamlStore addResource(Resource resource, String key, String... tags); Collection<TaggedPropertySet> parseConfiguration(); static final Charset DEFAULT_CHARSET; }### Answer:
@Test public void shouldParseCorrectly() { ConstrettoConfiguration conf = new ConstrettoBuilder() .createYamlConfigurationStore() .addResource(Resource.create("classpath:yamlTest.yaml"), "person") .done() .getConfiguration(); Person person = conf.evaluateWith(new PersonJsonConverter(), "person"); assertEquals(new Person("Kaare", 29), person); }
@Test public void shouldParseCorrectly2() { ConstrettoConfiguration conf = new ConstrettoBuilder() .createYamlConfigurationStore() .addResource(Resource.create("classpath:yamlTest2.yaml"), "person") .done() .getConfiguration(); Person person = conf.evaluateWith(new PersonJsonConverter(), "person"); assertEquals(new Person("Erlend", 34), person); }
@Test public void shouldAllowNonExistingResources() { ConstrettoConfiguration conf = new ConstrettoBuilder() .createYamlConfigurationStore() .addResource(Resource.create("classpath:nonExisiting.yaml"), "person") .addResource(Resource.create("file:/nonExisiting.yaml"), "person") .addResource(Resource.create("http:/nonExisiting.com"), "person") .done() .getConfiguration(); assertFalse(conf.hasValue("person")); }