Skip to content

Commit fe68cf4

Browse files
committed
Fixed exception messages
Otherwise TCK tests fail.
1 parent c6b25bf commit fe68cf4

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

driver/src/main/java/org/neo4j/driver/internal/InternalStatementResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Record single()
106106

107107
if ( hasMoreThanOne )
108108
{
109-
throw new NoSuchRecordException( "Expected result with a single record, but it contains " +
109+
throw new NoSuchRecordException( "Expected a result with a single record, but this result contains " +
110110
"at least one more. Ensure your query returns only one record." );
111111
}
112112

driver/src/main/java/org/neo4j/driver/internal/async/InternalStatementResultCursor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ public CompletionStage<Record> singleAsync()
9999
{
100100
if ( secondRecord != null )
101101
{
102-
throw new NoSuchRecordException( "Expected cursor with a single record, but it contains " +
103-
"at least one more. Ensure your query returns only one record." );
102+
throw new NoSuchRecordException( "Expected a cursor with a single record, but this cursor " +
103+
"contains at least one more. Ensure your query returns only " +
104+
"one record." );
104105
}
105106
return firstRecord;
106107
} );

driver/src/test/java/org/neo4j/driver/v1/integration/SessionAsyncIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ public void shouldFailSingleWithMultiRecordCursor()
588588
}
589589
catch ( NoSuchRecordException e )
590590
{
591-
assertThat( e.getMessage(), startsWith( "Expected cursor with a single record" ) );
591+
assertThat( e.getMessage(), startsWith( "Expected a cursor with a single record" ) );
592592
}
593593
}
594594

driver/src/test/java/org/neo4j/driver/v1/integration/TransactionAsyncIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ public void shouldFailSingleWithMultiRecordCursor()
694694
}
695695
catch ( NoSuchRecordException e )
696696
{
697-
assertThat( e.getMessage(), startsWith( "Expected cursor with a single record" ) );
697+
assertThat( e.getMessage(), startsWith( "Expected a cursor with a single record" ) );
698698
}
699699
}
700700

0 commit comments

Comments
 (0)