Skip to content

Commit

Permalink
Merge branch '5.0' into snyk-upgrade-d10292fb45b569328829d48f1ceba74b
Browse files Browse the repository at this point in the history
  • Loading branch information
Emrehzl94 authored Sep 13, 2024
2 parents ed0bfed + a9e83bc commit eb09184
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Neo4jSinkTaskTest {

@After
fun after() {
session.run("MATCH (n) DETACH DELETE n")
session.run("MATCH (n) DETACH DELETE n").consume()
task.stop()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package streams.kafka.connect.source
import org.apache.kafka.common.config.ConfigException
import org.junit.Test
import streams.kafka.connect.common.Neo4jConnectorConfig
import java.net.URI
import kotlin.test.assertEquals

class Neo4jSourceConnectorConfigTest {
Expand Down Expand Up @@ -78,4 +79,25 @@ class Neo4jSourceConnectorConfigTest {
assertEquals("$a:7687", config.serverUri[0].toString())
assertEquals("$b:7687", config.serverUri[1].toString())
}

@Test
fun `should parse multiple URIs`() {
val originals = mapOf(
Neo4jSourceConnectorConfig.SOURCE_TYPE to SourceType.QUERY.toString(),
Neo4jSourceConnectorConfig.SOURCE_TYPE_QUERY to "MATCH (n) RETURN n",
Neo4jSourceConnectorConfig.TOPIC to "topic",
Neo4jSourceConnectorConfig.STREAMING_POLL_INTERVAL to "10",
Neo4jSourceConnectorConfig.STREAMING_FROM to StreamingFrom.NOW.toString(),
Neo4jConnectorConfig.SERVER_URI to "neo4j://192.168.0.1:7687,neo4j://192.168.0.3:7687,neo4j://192.168.0.2"
)
val config = Neo4jSourceConnectorConfig(originals)

assertEquals(
config.serverUri, listOf(
URI("neo4j://192.168.0.1:7687"),
URI("neo4j://192.168.0.3:7687"),
URI("neo4j://192.168.0.2:7687"),
)
)
}
}

0 comments on commit eb09184

Please sign in to comment.