|
32 | 32 |
|
33 | 33 | import org.neo4j.driver.internal.spi.Connection; |
34 | 34 | import org.neo4j.driver.internal.value.NullValue; |
35 | | -import org.neo4j.driver.v1.Statement; |
36 | | -import org.neo4j.driver.v1.StatementResult; |
37 | | -import org.neo4j.driver.v1.util.Pair; |
38 | 35 | import org.neo4j.driver.v1.Record; |
39 | 36 | import org.neo4j.driver.v1.Records; |
| 37 | +import org.neo4j.driver.v1.Statement; |
| 38 | +import org.neo4j.driver.v1.StatementResult; |
40 | 39 | import org.neo4j.driver.v1.Value; |
41 | | -import org.neo4j.driver.v1.exceptions.ClientException; |
42 | 40 | import org.neo4j.driver.v1.exceptions.NoSuchRecordException; |
| 41 | +import org.neo4j.driver.v1.util.Pair; |
43 | 42 |
|
44 | 43 | import static org.hamcrest.CoreMatchers.equalTo; |
45 | 44 | import static org.hamcrest.collection.IsCollectionWithSize.hasSize; |
@@ -101,11 +100,25 @@ public void firstOfFieldIndexShouldWorkAsExpected() |
101 | 100 | } |
102 | 101 |
|
103 | 102 | @Test |
104 | | - public void singlePastFirstShouldFail() |
| 103 | + public void singlePastFirstTwoResultsShouldFail() |
105 | 104 | { |
106 | 105 | // GIVEN |
107 | 106 | StatementResult result = createResult( 2 ); |
108 | 107 | result.next(); |
| 108 | + |
| 109 | + |
| 110 | + // THEN |
| 111 | + expectedException.expect( NoSuchRecordException.class ); |
| 112 | + |
| 113 | + // THEN |
| 114 | + result.single(); |
| 115 | + } |
| 116 | + |
| 117 | + @Test |
| 118 | + public void singlePastFirstShouldFail() |
| 119 | + { |
| 120 | + // GIVEN |
| 121 | + StatementResult result = createResult( 2 ); |
109 | 122 | result.next(); |
110 | 123 |
|
111 | 124 |
|
@@ -234,16 +247,6 @@ public void retainAndMapByIndexShouldWorkAsExpected() |
234 | 247 | assertThat(records, hasSize( 3 ) ); |
235 | 248 | } |
236 | 249 |
|
237 | | - @Test |
238 | | - public void retainFailsIfItCannotRetainEntireResult() |
239 | | - { |
240 | | - StatementResult result = createResult( 17 ); |
241 | | - result.next(); |
242 | | - |
243 | | - expectedException.expect( ClientException.class ); |
244 | | - result.list(); |
245 | | - } |
246 | | - |
247 | 250 | @Test |
248 | 251 | public void accessingOutOfBoundsShouldBeNull() |
249 | 252 | { |
|
0 commit comments