Skip to content

Commit 4a77c8d

Browse files
committed
Merge branch 1.4 into 1.5
2 parents 19db50e + 34c85fb commit 4a77c8d

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

driver/src/test/java/org/neo4j/driver/v1/tck/DriverResultApiSteps.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.List;
3232
import java.util.Map;
3333

34+
import org.neo4j.driver.internal.util.ServerVersion;
3435
import org.neo4j.driver.v1.Statement;
3536
import org.neo4j.driver.v1.Value;
3637
import org.neo4j.driver.v1.summary.InputPosition;
@@ -45,6 +46,8 @@
4546
import static org.hamcrest.CoreMatchers.equalTo;
4647
import static org.hamcrest.CoreMatchers.instanceOf;
4748
import static org.hamcrest.MatcherAssert.assertThat;
49+
import static org.junit.Assert.assertNotNull;
50+
import static org.neo4j.driver.v1.tck.Environment.driver;
4851
import static org.neo4j.driver.v1.tck.Environment.runners;
4952
import static org.neo4j.driver.v1.tck.tck.util.ResultParser.getJavaValueIntAsLong;
5053
import static org.neo4j.driver.v1.tck.tck.util.ResultParser.getJavaValueNormalInts;
@@ -262,28 +265,33 @@ public void theSummaryHasNotifications( DataTable table ) throws Throwable
262265
case "position":
263266
Map<String,Object> expectedPosition = (Map<String,Object>) expected.get( key );
264267
InputPosition position = notification.position();
265-
for ( String positionKey : expectedPosition.keySet() )
268+
269+
if ( ServerVersion.version( driver ).greaterThanOrEqual( ServerVersion.v3_2_0 ) )
270+
{
271+
assertNotNull( position );
272+
}
273+
else
266274
{
267-
switch ( positionKey )
275+
for ( String positionKey : expectedPosition.keySet() )
268276
{
269-
case "offset":
270-
compareNotificationValue( position.offset(), expectedPosition.get( positionKey ) );
271-
break;
272-
case "line":
273-
compareNotificationValue( position.line(), expectedPosition.get( positionKey ) );
274-
break;
275-
case "column":
276-
compareNotificationValue( position.column(), expectedPosition.get( positionKey ) );
277-
break;
277+
switch ( positionKey )
278+
{
279+
case "offset":
280+
compareNotificationValue( position.offset(), expectedPosition.get( positionKey ) );
281+
break;
282+
case "line":
283+
compareNotificationValue( position.line(), expectedPosition.get( positionKey ) );
284+
break;
285+
case "column":
286+
compareNotificationValue( position.column(), expectedPosition.get( positionKey ) );
287+
break;
288+
}
278289
}
279290
}
280291
break;
281292
default:
282293
throw new IllegalArgumentException( "No case for " + key );
283294
}
284-
285-
286-
287295
}
288296
}
289297
}

0 commit comments

Comments
 (0)