sergey-chugunov-1985 commented on a change in pull request #56:
URL: https://github.com/apache/ignite-3/pull/56#discussion_r582610282



##########
File path: 
modules/configuration-annotation-processor/src/test/java/org/apache/ignite/configuration/sample/UsageTest.java
##########
@@ -35,36 +31,42 @@
      * Test creation of configuration and calling configuration API methods.
      */
     @Test
-    public void test() {
-        InitLocal initLocal = new InitLocal().withBaseline(
-            new InitBaseline()
-                .withNodes(
-                    new NamedList<>(
-                        Collections.singletonMap("node1", new 
InitNode().withConsistentId("test").withPort(1000))
+    public void test() throws Exception {
+        var registry = new ConfigurationRegistry();
+
+        registry.registerRootKey(LocalConfiguration.KEY);
+
+        registry.registerStorage(new TestConfigurationStorage());
+
+        LocalConfiguration root = 
registry.getConfiguration(LocalConfiguration.KEY);
+
+        root.change(local ->
+            local.changeBaseline(baseline ->
+                baseline.changeNodes(nodes ->
+                    nodes.create("node1", node ->
+                        node.initConsistentId("test").initPort(1000)
                     )
+                ).changeAutoAdjust(autoAdjust ->
+                    autoAdjust.changeEnabled(true).changeTimeout(100_000L)
                 )
-                .withAutoAdjust(new 
InitAutoAdjust().withEnabled(true).withTimeout(100000L))
-        );
-
-        final Configurator<LocalConfigurationImpl> configurator = 
Configurator.create(
-            LocalConfigurationImpl::new,
-            initLocal
-        );
-
-        final LocalConfiguration root = configurator.getRoot();
-        root.baseline().autoAdjust().enabled().value();
-
-        Assertions.assertThrows(ConfigurationValidationException.class, () -> {
-            configurator.set(Selectors.LOCAL_BASELINE_AUTO_ADJUST_ENABLED, 
false);
-        });
-        configurator.set(Selectors.LOCAL_BASELINE_AUTO_ADJUST, new 
ChangeAutoAdjust().withEnabled(false).withTimeout(0L));
-        
configurator.getRoot().baseline().nodes().get("node1").autoAdjustEnabled(false);
-        configurator.getRoot().baseline().autoAdjust().enabled(true);
-        
configurator.getRoot().baseline().nodes().get("node1").autoAdjustEnabled(true);
-
-        Assertions.assertThrows(ConfigurationValidationException.class, () -> {
-            configurator.getRoot().baseline().autoAdjust().enabled(false);
-        });
+            )
+        ).get();
+
+        assertTrue(root.baseline().autoAdjust().enabled().value());
+
+//        assertThrows(ConfigurationValidationException.class, () -> {

Review comment:
       add comment why it is turned off




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to