Skip to content

Commit

Permalink
Destination Snowflake add config file to test resources (#9518)
Browse files Browse the repository at this point in the history
* fix for jdk 17

* add config file

* add config file

Co-authored-by: vmaltsev <vitalii.maltsev@globallogic.com>
  • Loading branch information
VitaliiMaltsev and vmaltsev authored Jan 14, 2022
1 parent dbddd7b commit bca9499
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@
import io.airbyte.commons.io.IOs;
import io.airbyte.commons.jackson.MoreMappers;
import io.airbyte.commons.json.Jsons;
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.integrations.base.AirbyteMessageConsumer;
import io.airbyte.integrations.base.Destination;
import io.airbyte.protocol.models.AirbyteMessage;
import io.airbyte.protocol.models.AirbyteRecordMessage;
import io.airbyte.protocol.models.CatalogHelpers;
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog;
import io.airbyte.protocol.models.DestinationSyncMode;
import io.airbyte.protocol.models.Field;
import io.airbyte.protocol.models.JsonSchemaPrimitive;
import io.airbyte.protocol.models.*;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -81,8 +76,7 @@ public void testCleanupStageOnFailure() throws Exception {
JdbcDatabase mockDb = mock(JdbcDatabase.class);
SnowflakeStagingSqlOperations sqlOperations = mock(SnowflakeStagingSqlOperations.class);
final var testMessages = generateTestMessages();
final JsonNode config = Jsons.deserialize(IOs.readFile(Path.of("secrets/insert_config.json")));

final JsonNode config = Jsons.deserialize(MoreResources.readResource("insert_config.json"), JsonNode.class);
AirbyteMessageConsumer airbyteMessageConsumer = new SnowflakeInternalStagingConsumerFactory()
.create(Destination::defaultOutputRecordCollector, mockDb,
sqlOperations, new SnowflakeSQLNameTransformer(), config, getCatalog());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"host": "testhost.snowflakecomputing.com",
"role": "AIRBYTE_ROLE",
"warehouse": "AIRBYTE_WAREHOUSE",
"database": "AIRBYTE_DATABASE",
"schema": "AIRBYTE_SCHEMA",
"username": "AIRBYTE_INTEGRATION_TEST",
"password": "testPass"
}

0 comments on commit bca9499

Please sign in to comment.