Skip to content

Commit b639b18

Browse files
committed
Fix error message assertion
Which has changed in 3.5.
1 parent 0fa90e2 commit b639b18

File tree

1 file changed

+12
-7
lines changed
  • driver/src/test/java/org/neo4j/driver/v1/integration

1 file changed

+12
-7
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import static java.util.concurrent.TimeUnit.SECONDS;
5151
import static org.hamcrest.CoreMatchers.equalTo;
5252
import static org.hamcrest.CoreMatchers.startsWith;
53+
import static org.hamcrest.Matchers.containsString;
5354
import static org.hamcrest.Matchers.instanceOf;
5455
import static org.junit.Assert.assertEquals;
5556
import static org.junit.Assert.assertFalse;
@@ -159,14 +160,18 @@ public void shouldHandleFailureAtCommitTime() throws Throwable
159160
tx.run( "CREATE INDEX ON :`" + label + "`(name)" );
160161
tx.success();
161162

162-
// then expect
163-
exception.expect( ClientException.class );
164-
exception.expectMessage( "Label '" + label + "' and property 'name' have a unique " +
165-
"constraint defined on them, so an index is already created that matches this." );
166-
167163
// when
168-
tx.close();
169-
164+
try
165+
{
166+
tx.close();
167+
fail( "Exception expected" );
168+
}
169+
catch ( ClientException e )
170+
{
171+
// then
172+
assertThat( e.getMessage(), containsString( label ) );
173+
assertThat( e.getMessage(), containsString( "name" ) );
174+
}
170175
}
171176

172177
@Test

0 commit comments

Comments
 (0)