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


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/sql/ItSqlConnectBasicTest.java:
##########
@@ -21,31 +21,22 @@
 import static 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerHelper.createJdbcTestsBasicSecretConfig;
 import static org.junit.jupiter.api.Assertions.assertAll;
 
+import java.io.IOException;
 import org.apache.ignite.InitParametersBuilder;
+import 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerHelper;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Test;
 
 class ItSqlConnectBasicTest extends CliSqlConnectCommandTestBase {
 
     @Override
     protected void configureInitParameters(InitParametersBuilder builder) {
-        builder.clusterConfiguration(
-                "{\n"
-                + "  \"security\": {\n"
-                + "    \"authentication\": {\n"
-                + "      \"enabled\": true,\n"
-                + "      \"providers\": [\n"
-                + "        {\n"
-                + "          \"name\": \"basic\",\n"
-                + "          \"type\": \"basic\",\n"
-                + "          \"username\": \"usr\",\n"
-                + "          \"password\": \"pwd\"\n"
-                + "        }\n"
-                + "      ]\n"
-                + "    }\n"
-                + "  }\n"
-                + "}\n"
-        );
+        try {
+            String clusterConfig = 
TestConfigManagerHelper.readResourceToString("cluster-configuration-with-enabled-auth.conf");
+            builder.clusterConfiguration(clusterConfig);
+        } catch (IOException e) {

Review Comment:
   Do we really need this catch in every tests that uses this method?
   `readResourceToString` may throw different exception, there's nothing bad in 
such approach



##########
modules/cli/src/testFixtures/resources/cluster-configuration-with-enabled-auth.conf:
##########
@@ -0,0 +1,15 @@
+{

Review Comment:
   I'm not sure these braces are required. File would be simpler with no extra 
padding I think



##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/sql/ItSqlConnectBasicTest.java:
##########
@@ -21,31 +21,22 @@
 import static 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerHelper.createJdbcTestsBasicSecretConfig;
 import static org.junit.jupiter.api.Assertions.assertAll;
 
+import java.io.IOException;
 import org.apache.ignite.InitParametersBuilder;
+import 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerHelper;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Test;
 
 class ItSqlConnectBasicTest extends CliSqlConnectCommandTestBase {
 
     @Override
     protected void configureInitParameters(InitParametersBuilder builder) {
-        builder.clusterConfiguration(
-                "{\n"
-                + "  \"security\": {\n"
-                + "    \"authentication\": {\n"
-                + "      \"enabled\": true,\n"
-                + "      \"providers\": [\n"
-                + "        {\n"
-                + "          \"name\": \"basic\",\n"
-                + "          \"type\": \"basic\",\n"
-                + "          \"username\": \"usr\",\n"
-                + "          \"password\": \"pwd\"\n"
-                + "        }\n"
-                + "      ]\n"
-                + "    }\n"
-                + "  }\n"
-                + "}\n"
-        );
+        try {
+            String clusterConfig = 
TestConfigManagerHelper.readResourceToString("cluster-configuration-with-enabled-auth.conf");

Review Comment:
   Magic constant, you should probably move it to `TestConfigManagerHelper`



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