-
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.
Update Keen destination to use outputRecordCollector to properly stor…
…e state (#15291) * Update Keen destination to use outputRecordCollector to properly store state * Bump version * auto-bump connector version [ci skip] Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
- Loading branch information
1 parent
3861f0f
commit e28038e
Showing
7 changed files
with
71 additions
and
10 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
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
65 changes: 65 additions & 0 deletions
65
...n-keen/src/test/java/io/airbyte/integrations/destination/keen/KeenRecordConsumerTest.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,65 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.keen; | ||
|
||
import static io.airbyte.integrations.destination.keen.KeenDestination.CONFIG_API_KEY; | ||
import static io.airbyte.integrations.destination.keen.KeenDestination.CONFIG_PROJECT_ID; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.google.common.collect.ImmutableMap; | ||
import io.airbyte.commons.json.Jsons; | ||
import io.airbyte.integrations.base.FailureTrackingAirbyteMessageConsumer; | ||
import io.airbyte.integrations.standardtest.destination.PerStreamStateMessageTest; | ||
import io.airbyte.protocol.models.AirbyteMessage; | ||
import io.airbyte.protocol.models.CatalogHelpers; | ||
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; | ||
import io.airbyte.protocol.models.Field; | ||
import io.airbyte.protocol.models.JsonSchemaType; | ||
import java.util.List; | ||
import java.util.function.Consumer; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
@DisplayName("KafkaRecordConsumer") | ||
@ExtendWith(MockitoExtension.class) | ||
public class KeenRecordConsumerTest extends PerStreamStateMessageTest { | ||
|
||
private static final String SCHEMA_NAME = "public"; | ||
private static final String STREAM_NAME = "id_and_name"; | ||
|
||
private static final ConfiguredAirbyteCatalog CATALOG = new ConfiguredAirbyteCatalog().withStreams(List.of( | ||
CatalogHelpers.createConfiguredAirbyteStream( | ||
STREAM_NAME, | ||
SCHEMA_NAME, | ||
Field.of("id", JsonSchemaType.NUMBER), | ||
Field.of("name", JsonSchemaType.STRING)))); | ||
@Mock | ||
private Consumer<AirbyteMessage> outputRecordCollector; | ||
|
||
private KeenRecordsConsumer consumer; | ||
|
||
@BeforeEach | ||
public void init() { | ||
final JsonNode config = Jsons.jsonNode(ImmutableMap.builder() | ||
.put(CONFIG_PROJECT_ID, "test_project") | ||
.put(CONFIG_API_KEY, "test_apikey") | ||
.build()); | ||
consumer = new KeenRecordsConsumer(config, CATALOG, outputRecordCollector); | ||
} | ||
|
||
@Override | ||
protected Consumer<AirbyteMessage> getMockedConsumer() { | ||
return outputRecordCollector; | ||
} | ||
|
||
@Override | ||
protected FailureTrackingAirbyteMessageConsumer getMessageConsumer() { | ||
return consumer; | ||
} | ||
|
||
} |
File renamed without changes.