|
31 | 31 | import java.util.List;
|
32 | 32 | import java.util.Map;
|
33 | 33 |
|
| 34 | +import org.neo4j.driver.internal.util.ServerVersion; |
34 | 35 | import org.neo4j.driver.v1.Statement;
|
35 | 36 | import org.neo4j.driver.v1.Value;
|
36 | 37 | import org.neo4j.driver.v1.summary.InputPosition;
|
|
45 | 46 | import static org.hamcrest.CoreMatchers.equalTo;
|
46 | 47 | import static org.hamcrest.CoreMatchers.instanceOf;
|
47 | 48 | import static org.hamcrest.MatcherAssert.assertThat;
|
| 49 | +import static org.junit.Assert.assertNotNull; |
| 50 | +import static org.neo4j.driver.v1.tck.Environment.driver; |
48 | 51 | import static org.neo4j.driver.v1.tck.Environment.runners;
|
49 | 52 | import static org.neo4j.driver.v1.tck.tck.util.ResultParser.getJavaValueIntAsLong;
|
50 | 53 | import static org.neo4j.driver.v1.tck.tck.util.ResultParser.getJavaValueNormalInts;
|
@@ -262,28 +265,33 @@ public void theSummaryHasNotifications( DataTable table ) throws Throwable
|
262 | 265 | case "position":
|
263 | 266 | Map<String,Object> expectedPosition = (Map<String,Object>) expected.get( key );
|
264 | 267 | 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 |
266 | 274 | {
|
267 |
| - switch ( positionKey ) |
| 275 | + for ( String positionKey : expectedPosition.keySet() ) |
268 | 276 | {
|
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 | + } |
278 | 289 | }
|
279 | 290 | }
|
280 | 291 | break;
|
281 | 292 | default:
|
282 | 293 | throw new IllegalArgumentException( "No case for " + key );
|
283 | 294 | }
|
284 |
| - |
285 |
| - |
286 |
| - |
287 | 295 | }
|
288 | 296 | }
|
289 | 297 | }
|
|
0 commit comments