Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destination-dev-null: convert test code to kotlin #45649

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: file
connectorType: destination
definitionId: a7bcc9d8-13b3-4e49-b80d-d020b90045e3
dockerImageTag: 0.4.0
dockerImageTag: 0.4.1
dockerRepository: airbyte/destination-dev-null
githubIssueLabel: destination-dev-null
icon: airbyte.svg
Expand Down

This file was deleted.

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()
}
}

This file was deleted.

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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: unknown
connectorType: destination
definitionId: 2eb65e87-983a-4fd7-b3e3-9d9dc6eb8537
dockerImageTag: 0.4.0
dockerImageTag: 0.4.1
dockerRepository: airbyte/destination-e2e-test
githubIssueLabel: destination-e2e-test
icon: airbyte.svg
Expand Down

This file was deleted.

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()
}
}
Loading
Loading