ibessonov commented on a change in pull request #208:
URL: https://github.com/apache/ignite-3/pull/208#discussion_r670438925
##########
File path:
modules/configuration-annotation-processor/src/test/java/org/apache/ignite/internal/configuration/util/ConfigurationUtilTest.java
##########
@@ -266,59 +275,54 @@ public void fillFromPrefixMapSuccessfullyWithRemove() {
/** */
@Test
- public void nodeToFlatMap() {
- var parentNode = newParentInstance();
+ public void flattenedUpdatesMap() {
+ var superRoot = new SuperRoot(key -> null,
Map.of(ParentConfiguration.KEY, newParentInstance()));
assertEquals(
- emptyMap(),
- ConfigurationUtil.nodeToFlatMap(null, new SuperRoot(key -> null,
Map.of(
- ParentConfiguration.KEY,
- parentNode
- )))
+ Map.of(),
+ flattenedMap(superRoot, parent -> {})
);
- // No defaults in this test so everything must be initialized
explicitly.
- parentNode.changeElements(elements ->
- elements.create("name", element ->
- element.changeChild(child ->
- child.changeStr("foo")
+ assertEquals(
+ Map.of(
+ "root.elements.name.child.str", "foo",
+ "root.elements.name.<idx>", 0
+ ),
+ flattenedMap(superRoot, parent -> parent
+ .changeElements(elements -> elements
+ .create("name", element -> element
+ .changeChild(child -> child.changeStr("foo"))
+ )
)
)
);
assertEquals(
- singletonMap("root.elements.name.child.str", "foo"),
- ConfigurationUtil.nodeToFlatMap(null, new SuperRoot(key -> null,
Map.of(
- ParentConfiguration.KEY,
- parentNode
- )))
+ Map.of(),
+ flattenedMap(superRoot, parent -> parent
+ .changeElements(elements1 -> elements1.delete("void"))
+ )
);
assertEquals(
- emptyMap(),
- ConfigurationUtil.nodeToFlatMap(new SuperRoot(key -> null, Map.of(
- ParentConfiguration.KEY,
- parentNode
- )), new SuperRoot(key -> null, singletonMap(
- ParentConfiguration.KEY,
- (InnerNode)newParentInstance().changeElements(elements ->
- elements.delete("void")
- )
- )))
+ new HashMap<>() {{
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]