Skip to content

Commit 70c425c

Browse files
authored
test: always specify system DB when resetting database (#126)
This is due to a regression introduced in Neo4j 5.20.0. This also updates some of the driver/session usages throughout the test suite.
1 parent 3cf113b commit 70c425c

File tree

15 files changed

+121
-167
lines changed

15 files changed

+121
-167
lines changed

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.neo4j.connectors.kafka</groupId>

common/src/test/kotlin/org/neo4j/connectors/kafka/data/TypesTest.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import org.neo4j.connectors.kafka.data.ChangeEventExtensions.toConnectValue
4747
import org.neo4j.driver.AuthTokens
4848
import org.neo4j.driver.Driver
4949
import org.neo4j.driver.GraphDatabase
50-
import org.neo4j.driver.Session
50+
import org.neo4j.driver.SessionConfig
5151
import org.neo4j.driver.Values
5252
import org.testcontainers.containers.Neo4jContainer
5353
import org.testcontainers.junit.jupiter.Container
@@ -63,26 +63,25 @@ class TypesTest {
6363
.withoutAuthentication()
6464

6565
private lateinit var driver: Driver
66-
private lateinit var session: Session
6766

6867
@BeforeAll
6968
@JvmStatic
7069
fun setUpContainer() {
7170
driver = GraphDatabase.driver(neo4j.boltUrl, AuthTokens.none())
72-
session = driver.session()
7371
}
7472

7573
@AfterAll
7674
@JvmStatic
7775
fun tearDownContainer() {
78-
session.close()
7976
driver.close()
8077
}
8178
}
8279

8380
@BeforeEach
8481
fun `start with an empty database`() {
85-
driver.session().use { it.run("CREATE OR REPLACE DATABASE neo4j WAIT").consume() }
82+
driver.session(SessionConfig.forDatabase("system")).use {
83+
it.run("CREATE OR REPLACE DATABASE neo4j WAIT").consume()
84+
}
8685
}
8786

8887
@ParameterizedTest(name = "{0}")

legacy-connectors/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.neo4j.connectors.kafka</groupId>

packaging/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.neo4j.connectors.kafka</groupId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>org.neo4j.connectors.kafka</groupId>
66
<artifactId>parent</artifactId>

sink-connector/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.neo4j.connectors.kafka</groupId>

sink/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
66
<groupId>org.neo4j.connectors.kafka</groupId>

0 commit comments

Comments
 (0)