Flaugh24 commented on code in PR #1821:
URL: https://github.com/apache/ignite-3/pull/1821#discussion_r1149698296


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/cluster/init/ItClusterInitTest.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.cli.commands.cluster.init;
+
+import static org.junit.jupiter.api.Assertions.assertAll;
+
+import 
org.apache.ignite.internal.cli.commands.CliCommandTestNotInitializedIntegrationBase;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for {@link ClusterInitCommand}.
+ */
+public class ItClusterInitTest extends 
CliCommandTestNotInitializedIntegrationBase {
+
+    @Test
+    @DisplayName("Init cluster with basic authentication")
+    void initClusterWithBasicAuthentication() {
+
+        // when
+        execute("connect", "http://localhost:10301";);
+
+        resetOutput();
+
+        execute(
+                "cluster", "init",
+                "--meta-storage-node", CLUSTER_NODE_NAMES.get(0),
+                "--cluster-name", "cluster",
+                "--authentication-enabled",
+                "--basic-auth-login", "admin",
+                "--basic-auth-password", "password"
+        );
+
+        assertAll(
+                this::assertErrOutputIsEmpty,
+                () -> assertOutputContains("Cluster was initialized 
successfully")
+        );
+
+        // then
+        awaitClusterInitialized();
+
+        // basic authentication has been enabled
+        assertRestIsUnavailable();
+
+        // set basic authentication settings
+        execute("cli", "config", "set", 
"ignite.authentication.basic.login=admin");
+        execute("cli", "config", "set", 
"ignite.authentication.basic.password=password");

Review Comment:
   done



##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/Options.java:
##########
@@ -227,7 +245,22 @@ public static final class Constants {
         /** Unit path option description. */
         public static final String UNIT_PATH_OPTION_DESC = "Path to deployment 
unit file or directory";
 
-        /** Version option description. */
-        public static final String VERSION_OPTION_DESC = "Print version 
information and exit";
+        public static final String AUTHENTICATION_ENABLED_OPTION = 
"--authentication-enabled";

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]

Reply via email to