From 2c99735369b146cf0e2da8d5fd11ead84c949263 Mon Sep 17 00:00:00 2001 From: Joyce Ling <115662568+sfc-gh-ext-simba-jl@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:24:28 -0700 Subject: [PATCH] add error code 390400 to testHttpsLoginTimeoutWithOutSSL --- src/test/java/net/snowflake/client/jdbc/ConnectionIT.java | 1 + .../java/net/snowflake/client/jdbc/ConnectionLatestIT.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java b/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java index eee79a1cb..b027b55a0 100644 --- a/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java +++ b/src/test/java/net/snowflake/client/jdbc/ConnectionIT.java @@ -41,6 +41,7 @@ public class ConnectionIT extends BaseJDBCTest { public static final int INVALID_CONNECTION_INFO_CODE = 390100; private static final int SESSION_CREATION_OBJECT_DOES_NOT_EXIST_NOT_AUTHORIZED = 390201; private static final int ROLE_IN_CONNECT_STRING_DOES_NOT_EXIST = 390189; + public static final int BAD_REQUEST_GS_CODE = 390400; public static final int WAIT_FOR_TELEMETRY_REPORT_IN_MILLISECS = 5000; diff --git a/src/test/java/net/snowflake/client/jdbc/ConnectionLatestIT.java b/src/test/java/net/snowflake/client/jdbc/ConnectionLatestIT.java index f90cc5e60..c0789f0da 100644 --- a/src/test/java/net/snowflake/client/jdbc/ConnectionLatestIT.java +++ b/src/test/java/net/snowflake/client/jdbc/ConnectionLatestIT.java @@ -5,10 +5,12 @@ import static net.snowflake.client.core.SessionUtil.CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY; import static net.snowflake.client.jdbc.ConnectionIT.INVALID_CONNECTION_INFO_CODE; +import static net.snowflake.client.jdbc.ConnectionIT.BAD_REQUEST_GS_CODE; import static net.snowflake.client.jdbc.ConnectionIT.WAIT_FOR_TELEMETRY_REPORT_IN_MILLISECS; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.AnyOf.anyOf; import static org.junit.Assert.*; import com.fasterxml.jackson.databind.JsonNode; @@ -491,7 +493,10 @@ public void testHttpsLoginTimeoutWithOutSSL() throws InterruptedException { .equals(TelemetryService.TELEMETRY_SERVER_DEPLOYMENT.REG.getName())) { // a connection error response (wrong user and password) // with status code 200 is returned in RT - assertThat("Communication error", e.getErrorCode(), equalTo(INVALID_CONNECTION_INFO_CODE)); + assertThat( + "Communication error", + e.getErrorCode(), + anyOf(equalTo(INVALID_CONNECTION_INFO_CODE), equalTo(BAD_REQUEST_GS_CODE))); // since it returns normal response, // the telemetry does not create new event