ConfigNode { public String getString() { return value == null ? null : new ConfigValueParser.StringParser().compose(value); } ConfigNode(String key, ConfigNode parent, String value); Optional<ConfigNode> getNode(String path); boolean contains(String path); ConfigNode addNode(String path); boolean removeNode(String path); void remove(); boolean moveChild(String oldPath, String newPath); String getKey(boolean deep); void sort(); void reorder(List<String> newOrder); void save(); void set(String path, T value); void set(T value); List<String> getComment(); void setComment(List<String> comment); List<String> getStringList(); Integer getInteger(); Long getLong(); String getString(); boolean getBoolean(); List<String> getStringList(String path); Map<String, String> getStringMap(boolean fullKeys); Integer getInteger(String path); Long getLong(String path); String getString(String path); boolean getBoolean(String path); void copyMissing(ConfigNode from); void copyAll(ConfigNode from); ConfigNode getParent(); boolean isLeafNode(); Collection<ConfigNode> getChildren(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void normalStringValueIsParsedCorrectly() { String expected = "String"; String result = testTree.childNodes.get(SIMPLE_STRING_NODE).getString(); assertEquals(expected, result); }
@Test void normalStringValueIsParsedCorrectlyViaPath() { String expected = "String"; String result = testTree.getString(SIMPLE_STRING_NODE); assertEquals(expected, result); }
@Test void quotedStringValueIsParsedCorrectly() { String expected = "'String'"; String result = testTree.childNodes.get(STRING_NODE_WITH_QUOTES).getString(); assertEquals(expected, result); }
@Test void quotedStringValueIsParsedCorrectlyViaPath() { String expected = "'String'"; String result = testTree.getString(STRING_NODE_WITH_QUOTES); assertEquals(expected, result); }
@Test void doubleQuotedStringValueIsParsedCorrectly() { String expected = "\"String\""; String result = testTree.childNodes.get(STRING_NODE_WITH_DOUBLE_QUOTES).getString(); assertEquals(expected, result); }
@Test void doubleQuotedStringValueIsParsedCorrectlyViaPath() { String expected = "\"String\""; String result = testTree.getString(STRING_NODE_WITH_DOUBLE_QUOTES); assertEquals(expected, result); }
@Test void getStringReturnsValue() { String expected = "Value"; ConfigNode adding = new ConfigNode("Path", null, expected); String result = adding.getString(); assertEquals(expected, result); }
@Test void nonExistentStringValueIsNotParsed() { assertNull(testTree.getString("Non-existent")); }
@Test void nullValueIsReturnedAsNull() { assertNull(testTree.getString(FIRST_LEVEL)); }