-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15310: Destination Scylla: Handle per-stream state (#15399)
* 15310: Destination Scylla: Handle per-stream state * 15399: test fix * 15318: test fix * 15318: updating 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
c724630
commit aaa3aae
Showing
7 changed files
with
80 additions
and
8 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
71 changes: 71 additions & 0 deletions
71
...la/src/test/java/io/airbyte/integrations/destination/scylla/ScyllaRecordConsumerTest.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,71 @@ | ||
package io.airbyte.integrations.destination.scylla; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.integrations.base.FailureTrackingAirbyteMessageConsumer; | ||
import io.airbyte.integrations.standardtest.destination.PerStreamStateMessageTest; | ||
import io.airbyte.integrations.util.HostPortResolver; | ||
import io.airbyte.protocol.models.AirbyteMessage; | ||
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; | ||
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; | ||
import org.testcontainers.containers.GenericContainer; | ||
|
||
@DisplayName("ScyllaRecordConsumer") | ||
@ExtendWith(MockitoExtension.class) | ||
public class ScyllaRecordConsumerTest extends PerStreamStateMessageTest { | ||
private static ScyllaContainer scyllaContainer; | ||
|
||
@Mock | ||
private Consumer<AirbyteMessage> outputRecordCollector; | ||
|
||
private ScyllaMessageConsumer consumer; | ||
|
||
@Mock | ||
ScyllaConfig scyllaConfig; | ||
|
||
@Mock | ||
private ConfiguredAirbyteCatalog configuredCatalog; | ||
|
||
public static ScyllaContainer initContainer() { | ||
if (scyllaContainer == null) { | ||
scyllaContainer = new ScyllaContainer() | ||
.withExposedPorts(9042) | ||
// single cpu core cluster | ||
.withCommand("--smp 1"); | ||
} | ||
scyllaContainer.start(); | ||
return scyllaContainer; | ||
} | ||
|
||
@BeforeEach | ||
public void init() { | ||
ScyllaContainer scyllaContainer = initContainer(); | ||
JsonNode configJson = TestDataFactory.jsonConfig( | ||
HostPortResolver.resolveHost(scyllaContainer), | ||
HostPortResolver.resolvePort(scyllaContainer)); | ||
var scyllaConfig = new ScyllaConfig(configJson); | ||
consumer = new ScyllaMessageConsumer(scyllaConfig, configuredCatalog, outputRecordCollector); | ||
} | ||
|
||
@Override | ||
protected Consumer<AirbyteMessage> getMockedConsumer() { | ||
return outputRecordCollector; | ||
} | ||
|
||
@Override | ||
protected FailureTrackingAirbyteMessageConsumer getMessageConsumer() { | ||
return consumer; | ||
} | ||
|
||
static class ScyllaContainer extends GenericContainer<ScyllaContainer> { | ||
|
||
public ScyllaContainer() { | ||
super("scylladb/scylla:4.5.0"); | ||
} | ||
|
||
} | ||
} |
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