Skip to content

Commit 49c49d0

Browse files
committed
Fix more test that fail due to cypher deprecation removals
1 parent 6cbfe71 commit 49c49d0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

driver/src/test/java/org/neo4j/driver/integration/ConnectionHandlingIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void connectionUsedForTransactionReturnedToThePoolWhenTransactionFailsToCommitte
254254
{
255255
try ( Session session = driver.session() )
256256
{
257-
session.run( "CREATE CONSTRAINT ON (book:Library) ASSERT exists(book.isbn)" );
257+
session.run( "CREATE CONSTRAINT FOR (book:Library) REQUIRE book.isbn IS NOT NULL" );
258258
}
259259

260260
Connection connection1 = connectionPool.lastAcquiredConnectionSpy;

driver/src/test/java/org/neo4j/driver/integration/ErrorIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void shouldExplainConnectionError()
155155
void shouldHandleFailureAtRunTime()
156156
{
157157
String label = UUID.randomUUID().toString(); // avoid clashes with other tests
158-
String query = "CREATE CONSTRAINT ON (a:`" + label + "`) ASSERT a.name IS UNIQUE";
158+
String query = "CREATE CONSTRAINT FOR (a:`" + label + "`) REQUIRE a.name IS UNIQUE";
159159
// given
160160
Transaction tx = session.beginTransaction();
161161
tx.run( query );

driver/src/test/java/org/neo4j/driver/integration/SummaryIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void shouldContainCorrectStatistics()
128128
assertThat( session.run( "CREATE INDEX superIndex FOR (n:ALabel) ON (n.prop)" ).consume().counters().indexesAdded(), equalTo( 1 ) );
129129
assertThat( session.run( "DROP INDEX superIndex" ).consume().counters().indexesRemoved(), equalTo( 1 ) );
130130

131-
assertThat( session.run( "CREATE CONSTRAINT restrictedConstraint ON (book:Book) ASSERT book.isbn IS UNIQUE" )
131+
assertThat( session.run( "CREATE CONSTRAINT restrictedConstraint FOR (book:Book) REQUIRE book.isbn IS UNIQUE" )
132132
.consume().counters().constraintsAdded(), equalTo( 1 ) );
133133
assertThat( session.run( "DROP CONSTRAINT restrictedConstraint" )
134134
.consume().counters().constraintsRemoved(), equalTo( 1 ) );
@@ -152,7 +152,7 @@ void shouldContainCorrectQueryType()
152152
assertThat( session.run("MATCH (n) RETURN 1").consume().queryType(), equalTo( QueryType.READ_ONLY ));
153153
assertThat( session.run("CREATE (n)").consume().queryType(), equalTo( QueryType.WRITE_ONLY ));
154154
assertThat( session.run("CREATE (n) RETURN (n)").consume().queryType(), equalTo( QueryType.READ_WRITE ));
155-
assertThat( session.run("CREATE INDEX ON :User(p)").consume().queryType(), equalTo( QueryType.SCHEMA_WRITE ));
155+
assertThat( session.run("CREATE INDEX FOR (n:User) ON n.p").consume().queryType(), equalTo( QueryType.SCHEMA_WRITE ));
156156
}
157157

158158
@Test

0 commit comments

Comments
 (0)