Skip to content

Commit

Permalink
add error code 390400 to testHttpsLoginTimeoutWithOutSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jl committed Sep 27, 2023
1 parent 14c1318 commit 2c99735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/java/net/snowflake/client/jdbc/ConnectionIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2c99735

Please sign in to comment.