Skip to content

Commit

Permalink
Fixed "Ensure no file change" build issue. Only checkstyle changes, n…
Browse files Browse the repository at this point in the history
…o logic chnages (#17885)
  • Loading branch information
etsybaev authored Oct 12, 2022
1 parent 0abeff9 commit 33dfd5d
Show file tree
Hide file tree
Showing 130 changed files with 5,161 additions and 7,050 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2022 Airbyte, Inc., all rights reserved.
*/

package io.airbyte.integrations.destination.aws_datalake;

import io.airbyte.integrations.standardtest.destination.comparator.AdvancedTestDataComparator;
Expand All @@ -14,4 +18,5 @@ protected List<String> resolveIdentifier(String identifier) {
result.add(identifier.toLowerCase(Locale.ROOT));
return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"rec_lvl_12": {
"rec_lvl_13": {
"rec_lvl_14": {
"str_value" : "test_value"
"str_value": "test_value"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"rec_lvl_13": {
"rec_lvl_14": {
"rec_lvl_15": {
"str_value" : "test_value"
"str_value": "test_value"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,50 @@
{
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_1": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_2": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_3": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_4": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_5": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_6": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_7": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_8": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_9": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_10": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_11": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_12": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_13": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_14": {
"type": [
"object"
],
"type": ["object"],
"properties": {

"str_value" : {
"type": [
"string"
]


"str_value": {
"type": ["string"]
}
}
}
Expand Down Expand Up @@ -110,4 +75,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,84 +1,54 @@
{
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_1": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_2": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_3": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_4": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_5": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_6": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_7": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_8": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_9": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_10": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_11": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_12": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_13": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_14": {
"type": [
"object"
],
"type": ["object"],
"properties": {
"rec_lvl_15": {
"type": [
"object"
],
"properties": {
"str_value" : {
"str_value": {
"type": [
"string"
]
Expand Down Expand Up @@ -114,4 +84,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.sql.SQLException;
import java.time.Duration;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Kinesis Destination Spec",
"type": "object",
"required": ["endpoint", "region", "shardCount", "accessKey", "privateKey", "bufferSize"],
"required": [
"endpoint",
"region",
"shardCount",
"accessKey",
"privateKey",
"bufferSize"
],
"additionalProperties": true,
"properties": {
"endpoint": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.junit.jupiter.api.Test;

public class MariadbSpecTest {

private static JsonNode schema;
private static JsonNode config;
private static String configText;
Expand All @@ -32,15 +33,15 @@ public class MariadbSpecTest {
@BeforeAll
static void init() throws IOException {
configText = """
{
"host": "localhost",
"port": 1521,
"username": "mariadb",
"password": "password",
"database": "db",
"jdbc_url_params": "property1=pValue1&property2=pValue2"
}
""";
{
"host": "localhost",
"port": 1521,
"username": "mariadb",
"password": "password",
"database": "db",
"jdbc_url_params": "property1=pValue1&property2=pValue2"
}
""";
final String spec = MoreResources.readResource("spec.json");
final File schemaFile = IOs.writeFile(Files.createTempDirectory(Path.of("/tmp"), "spec-test"), "schema.json", spec).toFile();
schema = JsonSchemaValidator.getSchema(schemaFile).get("connectionSpecification");
Expand Down Expand Up @@ -92,4 +93,5 @@ void testJdbcAdditionalProperty() throws Exception {
final ConnectorSpecification spec = new MariadbColumnstoreDestination().spec();
assertNotNull(spec.getConnectionSpecification().get("properties").get("jdbc_url_params"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.annotations.VisibleForTesting;
import com.mongodb.client.MongoCollection;
import com.mongodb.MongoCommandException;
import com.mongodb.MongoException;
import com.mongodb.MongoSecurityException;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import io.airbyte.commons.util.MoreIterators;
import io.airbyte.db.exception.ConnectionErrorException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import io.airbyte.integrations.destination.ExtendedNameTransformer;
import io.airbyte.integrations.standardtest.destination.comparator.AdvancedTestDataComparator;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
Expand Down Expand Up @@ -34,22 +33,22 @@ protected boolean compareBooleanValues(String firstBooleanValue, String secondBo
return super.compareBooleanValues(firstBooleanValue, secondBooleanValue);
} else {
return super.compareBooleanValues(firstBooleanValue,
String.valueOf(secondBooleanValue.equals("1")));
String.valueOf(secondBooleanValue.equals("1")));
}
}

@Override
protected boolean compareDateTimeValues(String expectedValue, String actualValue) {
var destinationDate = parseLocalDateTime(actualValue);
var expectedDate = LocalDate.parse(expectedValue,
DateTimeFormatter.ofPattern(AIRBYTE_DATETIME_FORMAT));
DateTimeFormatter.ofPattern(AIRBYTE_DATETIME_FORMAT));
return expectedDate.equals(destinationDate);
}

private LocalDate parseLocalDateTime(String dateTimeValue) {
if (dateTimeValue != null) {
return LocalDate.parse(dateTimeValue,
DateTimeFormatter.ofPattern(getFormat(dateTimeValue)));
DateTimeFormatter.ofPattern(getFormat(dateTimeValue)));
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package io.airbyte.integrations.destination.postgres;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.airbyte.commons.json.Jsons;
import io.airbyte.db.jdbc.JdbcUtils;
Expand All @@ -31,7 +30,6 @@ public class PostgresDestinationStrictEncrypt extends SpecModifyingDestination i
public static final String SSL_MODE_PREFER = "prefer";
public static final String SSL_MODE_DISABLE = "disable";


public PostgresDestinationStrictEncrypt() {
super(PostgresDestination.sshWrappedDestination());
}
Expand All @@ -48,13 +46,14 @@ public AirbyteConnectionStatus check(final JsonNode config) throws Exception {
if (config.has(TUNNEL_METHOD)
&& config.get(TUNNEL_METHOD).has(TUNNEL_METHOD)
&& config.get(TUNNEL_METHOD).get(TUNNEL_METHOD).asText().equals(NO_TUNNEL)) {
//If no SSH tunnel
// If no SSH tunnel
if (config.has(SSL_MODE) && config.get(SSL_MODE).has(MODE)) {
if (Set.of(SSL_MODE_DISABLE, SSL_MODE_ALLOW, SSL_MODE_PREFER).contains(config.get(SSL_MODE).get(MODE).asText())) {
//Fail in case SSL mode is disable, allow or prefer
// Fail in case SSL mode is disable, allow or prefer
return new AirbyteConnectionStatus()
.withStatus(Status.FAILED)
.withMessage("Unsecured connection not allowed. If no SSH Tunnel set up, please use one of the following SSL modes: require, verify-ca, verify-full");
.withMessage(
"Unsecured connection not allowed. If no SSH Tunnel set up, please use one of the following SSL modes: require, verify-ca, verify-full");
}
}
}
Expand Down
Loading

0 comments on commit 33dfd5d

Please sign in to comment.