You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ibessonov (via GitHub)" <gi...@apache.org> on 2023/01/24 15:47:19 UTC

[GitHub] [ignite-3] ibessonov commented on a diff in pull request #1570: IGNITE-18601 Copy configuration tree when adding default values

ibessonov commented on code in PR #1570:
URL: https://github.com/apache/ignite-3/pull/1570#discussion_r1085520722


##########
modules/configuration/src/test/java/org/apache/ignite/internal/configuration/util/ConfigurationUtilTest.java:
##########
@@ -808,6 +809,26 @@ void testRemoveLastKey() {
         assertEquals(List.of("0"), removeLastKey(List.of("0", "1")));
     }
 
+    /**
+     * Tests that {@link ConfigurationUtil#addDefaults} copies the tree when adding default values.
+     */
+    @Test
+    void testAddDefaultsPurity() {
+        InnerNode parentNode = newNodeInstance(ParentConfigurationSchema.class);
+
+        ParentChange parentChange = (ParentChange) parentNode;
+
+        parentChange.changeElements(elements -> elements.create("name", element -> {}));
+
+        NamedListNode<?> beforeDefaults = find(List.of("elements"), parentNode, true);

Review Comment:
   `find(List.of("elements"), parentNode, true)`
   This is equivalent to `parentChange.elements()`



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org