/**
* RtYamlMapping can return null if the specified key is missig.
*/
@Test
public void returnsNullOnMissingKey() {
Map<YamlNode, YamlNode> mappings = new HashMap<>();
mappings.put(new Scalar("key3"), Mockito.mock(YamlSequence.class));
mappings.put(new Scalar("key1"), Mockito.mock(YamlMapping.class));
RtYamlMapping map = new RtYamlMapping(mappings);
MatcherAssert.assertThat(
map.yamlSequence("key4"), Matchers.nullValue()
);
MatcherAssert.assertThat(
map.yamlMapping("key4"), Matchers.nullValue()
);
MatcherAssert.assertThat(
map.string("key4"), Matchers.nullValue()
);
MatcherAssert.assertThat(
map.yamlSequence("key1"), Matchers.nullValue()
);
}
RtYamlMappingTest.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:camel
作者:
评论列表
文章目录