Skip to content

Commit 37e3293

Browse files
committed
add unsafecast test
1 parent 6303575 commit 37e3293

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

airbyte-cdk/java/airbyte-cdk/typing-deduping/src/testFixtures/java/io/airbyte/integrations/base/destination/typing_deduping/BaseSqlGeneratorIntegrationTest.java

+17
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import static org.junit.jupiter.api.Assertions.assertThrows;
1515
import static org.junit.jupiter.api.Assertions.assertTrue;
1616
import static org.junit.jupiter.api.Assertions.fail;
17+
import static org.junit.jupiter.api.Assumptions.assumeFalse;
1718
import static org.junit.jupiter.api.Assumptions.assumeTrue;
1819

1920
import com.fasterxml.jackson.databind.JsonNode;
@@ -33,6 +34,7 @@
3334
import java.util.stream.Stream;
3435
import org.apache.commons.lang3.tuple.Pair;
3536
import org.junit.jupiter.api.AfterEach;
37+
import org.junit.jupiter.api.Assumptions;
3638
import org.junit.jupiter.api.BeforeEach;
3739
import org.junit.jupiter.api.Test;
3840
import org.junit.jupiter.api.parallel.Execution;
@@ -433,6 +435,21 @@ public void allTypes() throws Exception {
433435
assertFalse(destinationHandler.isFinalTableEmpty(streamId), "Final table should not be empty after T+D");
434436
}
435437

438+
@Test
439+
public void allTypesSafeCastUnsupported() throws Exception {
440+
assumeFalse(supportsSafeCast(), "Skipping test because this connector supports safe casting");
441+
442+
createRawTable(streamId);
443+
createFinalTable(incrementalDedupStream, "");
444+
insertRawTableRecords(
445+
streamId,
446+
BaseTypingDedupingTest.readRecords("sqlgenerator/alltypes_inputrecords.jsonl"));
447+
448+
assertThrows(
449+
Exception.class,
450+
() -> TypeAndDedupeTransaction.executeTypeAndDedupe(generator, destinationHandler, incrementalDedupStream, Optional.empty(), ""));
451+
}
452+
436453
/**
437454
* Run a basic test to verify that we don't throw an exception on basic data values.
438455
*/

0 commit comments

Comments
 (0)