-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
destination-e2e: convert test code to kotlin
- Loading branch information
1 parent
b64a103
commit 9024b73
Showing
11 changed files
with
239 additions
and
235 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
78 changes: 0 additions & 78 deletions
78
...n/java/io/airbyte/integrations/destination/dev_null/DevNullDestinationAcceptanceTest.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
...n/kotlin/io/airbyte/integrations/destination/dev_null/DevNullDestinationAcceptanceTest.kt
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,75 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
package io.airbyte.integrations.destination.dev_null | ||
|
||
import com.fasterxml.jackson.databind.JsonNode | ||
import io.airbyte.cdk.integrations.standardtest.destination.DestinationAcceptanceTest | ||
import io.airbyte.commons.json.Jsons | ||
import io.airbyte.protocol.models.v0.AirbyteMessage | ||
import io.airbyte.protocol.models.v0.AirbyteRecordMessage | ||
import java.util.* | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Disabled | ||
import org.junit.jupiter.api.Test | ||
|
||
class DevNullDestinationAcceptanceTest : DestinationAcceptanceTest() { | ||
override fun getImageName(): String { | ||
return "airbyte/destination-dev-null:dev" | ||
} | ||
|
||
override fun getConfig(): JsonNode { | ||
return Jsons.jsonNode( | ||
Collections.singletonMap( | ||
"test_destination", | ||
Collections.singletonMap("test_destination_type", "SILENT") | ||
) | ||
) | ||
} | ||
|
||
override fun getFailCheckConfig(): JsonNode { | ||
return Jsons.jsonNode( | ||
Collections.singletonMap( | ||
"test_destination", | ||
Collections.singletonMap("test_destination_type", "invalid") | ||
) | ||
) | ||
} | ||
|
||
override fun retrieveRecords( | ||
testEnv: TestDestinationEnv, | ||
streamName: String, | ||
namespace: String?, | ||
streamSchema: JsonNode | ||
): List<JsonNode> { | ||
return emptyList() | ||
} | ||
|
||
override fun setup(testEnv: TestDestinationEnv, TEST_SCHEMAS: HashSet<String>) { | ||
// do nothing | ||
} | ||
|
||
override fun tearDown(testEnv: TestDestinationEnv) { | ||
// do nothing | ||
} | ||
|
||
override fun assertSameMessages( | ||
expected: List<AirbyteMessage>, | ||
actual: List<AirbyteRecordMessage>, | ||
pruneAirbyteInternalFields: Boolean | ||
) { | ||
Assertions.assertEquals(0, actual.size) | ||
} | ||
|
||
// Skip because `retrieveRecords` returns an empty list at all times. | ||
@Disabled @Test override fun testSyncNotFailsWithNewFields() {} | ||
|
||
// This test assumes that dedup support means normalization support. | ||
// Override it to do nothing. | ||
@Disabled | ||
@Test | ||
@Throws(Exception::class) | ||
override fun testIncrementalDedupeSync() { | ||
super.testIncrementalDedupeSync() | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
...ll/src/test/java/io/airbyte/integrations/destination/dev_null/DevNullDestinationTest.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
...ll/src/test/kotlin/io/airbyte/integrations/destination/dev_null/DevNullDestinationTest.kt
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,25 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
package io.airbyte.integrations.destination.dev_null | ||
|
||
import io.airbyte.commons.json.Jsons | ||
import io.airbyte.commons.resources.MoreResources | ||
import io.airbyte.protocol.models.v0.ConnectorSpecification | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
|
||
internal class DevNullDestinationTest { | ||
@Test | ||
@Throws(Exception::class) | ||
fun testSpec() { | ||
val actual = DevNullDestination().spec() | ||
val expected = | ||
Jsons.deserialize( | ||
MoreResources.readResource("expected_spec.json"), | ||
ConnectorSpecification::class.java | ||
) | ||
|
||
Assertions.assertEquals(expected, actual) | ||
} | ||
} |
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
79 changes: 0 additions & 79 deletions
79
.../io/airbyte/integrations/destination/e2e_test/TestingSilentDestinationAcceptanceTest.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
...in/io/airbyte/integrations/destination/e2e_test/TestingSilentDestinationAcceptanceTest.kt
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,75 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
package io.airbyte.integrations.destination.e2e_test | ||
|
||
import com.fasterxml.jackson.databind.JsonNode | ||
import io.airbyte.cdk.integrations.standardtest.destination.DestinationAcceptanceTest | ||
import io.airbyte.commons.json.Jsons | ||
import io.airbyte.integrations.destination.e2e_test.TestingDestinations.TestDestinationType | ||
import io.airbyte.protocol.models.v0.* | ||
import java.util.* | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Disabled | ||
import org.junit.jupiter.api.Test | ||
|
||
class TestingSilentDestinationAcceptanceTest : DestinationAcceptanceTest() { | ||
override fun getImageName(): String { | ||
return "airbyte/destination-e2e-test:dev" | ||
} | ||
|
||
override fun getConfig(): JsonNode { | ||
return Jsons.jsonNode( | ||
Collections.singletonMap( | ||
"test_destination", | ||
Collections.singletonMap("test_destination_type", TestDestinationType.SILENT.name) | ||
) | ||
) | ||
} | ||
|
||
override fun getFailCheckConfig(): JsonNode { | ||
return Jsons.jsonNode( | ||
Collections.singletonMap( | ||
"test_destination", | ||
Collections.singletonMap("test_destination_type", "invalid") | ||
) | ||
) | ||
} | ||
|
||
override fun retrieveRecords( | ||
testEnv: TestDestinationEnv?, | ||
streamName: String?, | ||
namespace: String?, | ||
streamSchema: JsonNode? | ||
): List<JsonNode> { | ||
return emptyList() | ||
} | ||
|
||
override fun setup(testEnv: TestDestinationEnv, TEST_SCHEMAS: HashSet<String>) { | ||
// do nothing | ||
} | ||
|
||
override fun tearDown(testEnv: TestDestinationEnv) { | ||
// do nothing | ||
} | ||
|
||
override fun assertSameMessages( | ||
expected: List<AirbyteMessage>, | ||
actual: List<AirbyteRecordMessage>, | ||
pruneAirbyteInternalFields: Boolean | ||
) { | ||
Assertions.assertEquals(0, actual.size) | ||
} | ||
|
||
// Skip because `retrieveRecords` returns an empty list at all times. | ||
@Disabled @Test override fun testSyncNotFailsWithNewFields() {} | ||
|
||
// This test assumes that dedup support means normalization support. | ||
// Override it to do nothing. | ||
@Disabled | ||
@Test | ||
@Throws(Exception::class) | ||
override fun testIncrementalDedupeSync() { | ||
super.testIncrementalDedupeSync() | ||
} | ||
} |
Oops, something went wrong.