-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MySql destination : Enable DAT tests (#12866)
* add MySqlTestDataComparator * enable new DAT * enable new DAT * handle json type + fix boolean compare for both cases * format
- Loading branch information
1 parent
1edc0de
commit 5aa7fe7
Showing
6 changed files
with
140 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...t-integration/java/io/airbyte/integrations/destination/mysql/MySqlTestDataComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.mysql; | ||
|
||
import io.airbyte.integrations.destination.ExtendedNameTransformer; | ||
import io.airbyte.integrations.standardtest.destination.comparator.AdvancedTestDataComparator; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class MySqlTestDataComparator extends AdvancedTestDataComparator { | ||
|
||
private final ExtendedNameTransformer namingResolver = new MySQLNameTransformer(); | ||
|
||
@Override | ||
protected List<String> resolveIdentifier(final String identifier) { | ||
final List<String> result = new ArrayList<>(); | ||
final String resolved = namingResolver.getIdentifier(identifier); | ||
result.add(identifier); | ||
result.add(resolved); | ||
if (!resolved.startsWith("\"")) { | ||
result.add(resolved.toLowerCase()); | ||
} | ||
return result; | ||
} | ||
|
||
@Override | ||
protected boolean compareBooleanValues(String firstBooleanValue, String secondBooleanValue) { | ||
if (secondBooleanValue.equalsIgnoreCase("true") || secondBooleanValue.equalsIgnoreCase("false")) { | ||
return super.compareBooleanValues(firstBooleanValue, secondBooleanValue); | ||
} else { | ||
return super.compareBooleanValues(firstBooleanValue, String.valueOf(secondBooleanValue.equals("1"))); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.