Skip to content

Commit f17f447

Browse files
committed
Added bookmark it
1 parent 3d5502d commit f17f447

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package org.neo4j.driver.v1.integration;
2+
3+
import org.junit.Before;
4+
import org.junit.Rule;
5+
import org.junit.Test;
6+
import org.junit.rules.ExpectedException;
7+
8+
import org.neo4j.driver.v1.Transaction;
9+
import org.neo4j.driver.v1.util.ServerVersion;
10+
import org.neo4j.driver.v1.util.TestNeo4jSession;
11+
12+
import static org.junit.Assert.assertNotNull;
13+
import static org.junit.Assert.assertNull;
14+
import static org.junit.Assume.assumeTrue;
15+
16+
import static org.neo4j.driver.v1.util.ServerVersion.v3_1_0;
17+
18+
public class BookmarkIT
19+
{
20+
@Rule
21+
public ExpectedException exception = ExpectedException.none();
22+
@Rule
23+
public TestNeo4jSession session = new TestNeo4jSession();
24+
25+
@Before
26+
public void assumeBookmarkSupport()
27+
{
28+
System.out.println(session.server());
29+
assumeTrue( ServerVersion.version( session.server() ).greaterThanOrEqual( v3_1_0 ) );
30+
}
31+
32+
@Test
33+
public void shouldReceiveBookmarkOnSuccessfulCommit() throws Throwable
34+
{
35+
// Given
36+
assertNull( session.lastBookmark() );
37+
38+
// When
39+
try ( Transaction tx = session.beginTransaction() )
40+
{
41+
tx.run( "CREATE (a:Person)" );
42+
tx.success();
43+
}
44+
45+
// Then
46+
assertNotNull( session.lastBookmark() );
47+
}
48+
}

0 commit comments

Comments
 (0)