Skip to content

Commit

Permalink
FIR-26385 send additional parameters to real engine only
Browse files Browse the repository at this point in the history
  • Loading branch information
alexradzin committed Sep 11, 2023
1 parent b194b2b commit 8c293a5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/integrationTest/java/integration/tests/ConnectionTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package integration.tests;

import integration.ConnectionInfo;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import static java.lang.String.format;
import static org.junit.jupiter.api.Assertions.assertNotNull;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class ConnectionTest {
/**
* This test connects to specific engine with additional property {@code use_standard_sql} supported by user engine but
* not supported by system engine used here to retrieve the data of user engine.
* The test is needed because there were create connection to system engine by copying all given connection properties
* while additional (custom) parameters should be ignored.
* @throws SQLException if something went wrong
*/
@Test
void connectionWithAdditionalProperties() throws SQLException {
ConnectionInfo params = integration.ConnectionInfo.getInstance();
String url = format("jdbc:firebolt:%s?env=%s&engine=%s&account=%s&use_standard_sql=1", params.getDatabase(), params.getEnv(), params.getEngine(), params.getAccount());
try(Connection connection = DriverManager.getConnection(url, params.getPrincipal(), params.getSecret())) {
assertNotNull(connection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private FireboltProperties createInternalSystemEngineProperties(String accessTok
return this.loginProperties
.toBuilder()
.systemEngine(true)
.additionalProperties(Map.of())
.compress(false)
.host(UrlUtil.createUrl(systemEngineEndpoint).getHost()).database(null).build();
}
Expand Down

0 comments on commit 8c293a5

Please sign in to comment.