You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/01 16:54:54 UTC

[GitHub] [ignite-3] sashapolo commented on a change in pull request #475: IGNITE-16009 Use column and index names as Named List keys

sashapolo commented on a change in pull request #475:
URL: https://github.com/apache/ignite-3/pull/475#discussion_r760378186



##########
File path: modules/configuration/src/test/java/org/apache/ignite/internal/configuration/tree/NamedListNodeTest.java
##########
@@ -347,4 +348,36 @@ public void errors() throws Exception {
         b.delete("X");
         b.delete("Y");
     }
+
+    /**
+     * Tests the {@link NamedListNode#update} method.
+     */
+    @Test
+    public void testUpdate() {
+        var list = new NamedListNode<SecondChange>("name", () -> cgen.instantiateNode(SecondConfigurationSchema.class), null);
+
+        list.create("foo", ch -> ch.changeStr("bar"));
+
+        assertThat(list.get("foo").str(), is(equalTo("bar")));
+
+        list.update("foo", ch -> ch.changeStr("baz"));
+
+        assertThat(list.get("foo").str(), is(equalTo("baz")));
+
+        list.delete("foo");
+
+        // updating a removed key should throw
+        assertThrows(IllegalArgumentException.class, () -> list.update("foo", ch -> {}));

Review comment:
       I've created a ticket: https://issues.apache.org/jira/browse/IGNITE-16042




-- 
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