Skip to content

Commit e9e2d7a

Browse files
committed
Remove trailing &
1 parent c1eccd4 commit e9e2d7a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

airbyte-integrations/connectors/destination-mysql/src/main/java/io/airbyte/integrations/destination/mysql/MySQLDestination.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public JsonNode toJdbcConfig(final JsonNode config) {
109109
// since zero dates are placeholders, we convert them to null by default
110110
if (!additionalParameters.isEmpty()) {
111111
jdbcUrl.append("?");
112-
additionalParameters.forEach(x -> jdbcUrl.append(x).append("&"));
112+
jdbcUrl.append(String.join("&", additionalParameters));
113113
}
114114

115115
final ImmutableMap.Builder<Object, Object> configBuilder = ImmutableMap.builder()

airbyte-integrations/connectors/destination-mysql/src/test/java/io/airbyte/integrations/destination/mysql/MySQLDestinationTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ private JsonNode buildConfigNoExtraJdbcParametersWithoutSsl() {
6868
void testNoExtraParams() {
6969
final JsonNode jdbcConfig = getDestination().toJdbcConfig(buildConfigNoJdbcParameters());
7070
final String url = jdbcConfig.get("jdbc_url").asText();
71-
assertEquals("jdbc:mysql://localhost:1337/db?verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true&", url);
71+
assertEquals("jdbc:mysql://localhost:1337/db?verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true", url);
7272
}
7373

7474
@Test
7575
void testEmptyExtraParams() {
7676
final JsonNode jdbcConfig = getDestination().toJdbcConfig(buildConfigWithExtraJdbcParameters(""));
7777
final String url = jdbcConfig.get("jdbc_url").asText();
78-
assertEquals("jdbc:mysql://localhost:1337/db?verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true&", url);
78+
assertEquals("jdbc:mysql://localhost:1337/db?verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true", url);
7979
}
8080

8181
@Test
@@ -84,7 +84,7 @@ void testExtraParams() {
8484
final JsonNode jdbcConfig = getDestination().toJdbcConfig(buildConfigWithExtraJdbcParameters(extraParam));
8585
final String url = jdbcConfig.get("jdbc_url").asText();
8686
assertEquals(
87-
"jdbc:mysql://localhost:1337/db?key1=value1&key2=value2&key3=value3&verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true&",
87+
"jdbc:mysql://localhost:1337/db?key1=value1&key2=value2&key3=value3&verifyServerCertificate=false&zeroDateTimeBehavior=convertToNull&requireSSL=true&useSSL=true",
8888
url);
8989
}
9090

@@ -113,7 +113,7 @@ void testExtraParameterNoSsl() {
113113
final JsonNode jdbcConfig = getDestination().toJdbcConfig(buildConfigWithExtraJdbcParametersWithNoSsl(extraParam));
114114
final String url = jdbcConfig.get("jdbc_url").asText();
115115
assertEquals(
116-
"jdbc:mysql://localhost:1337/db?key1=value1&key2=value2&key3=value3&zeroDateTimeBehavior=convertToNull&",
116+
"jdbc:mysql://localhost:1337/db?key1=value1&key2=value2&key3=value3&zeroDateTimeBehavior=convertToNull",
117117
url);
118118
}
119119

@@ -122,7 +122,7 @@ void testNoExtraParameterNoSsl() {
122122
final JsonNode jdbcConfig = getDestination().toJdbcConfig(buildConfigNoExtraJdbcParametersWithoutSsl());
123123
final String url = jdbcConfig.get("jdbc_url").asText();
124124
assertEquals(
125-
"jdbc:mysql://localhost:1337/db?zeroDateTimeBehavior=convertToNull&",
125+
"jdbc:mysql://localhost:1337/db?zeroDateTimeBehavior=convertToNull",
126126
url);
127127
}
128128

0 commit comments

Comments
 (0)