File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
driver/src/test/java/org/neo4j/driver/v1/integration Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 50
50
import static java .util .concurrent .TimeUnit .SECONDS ;
51
51
import static org .hamcrest .CoreMatchers .equalTo ;
52
52
import static org .hamcrest .CoreMatchers .startsWith ;
53
+ import static org .hamcrest .Matchers .containsString ;
53
54
import static org .hamcrest .Matchers .instanceOf ;
54
55
import static org .junit .Assert .assertEquals ;
55
56
import static org .junit .Assert .assertFalse ;
@@ -159,14 +160,18 @@ public void shouldHandleFailureAtCommitTime() throws Throwable
159
160
tx .run ( "CREATE INDEX ON :`" + label + "`(name)" );
160
161
tx .success ();
161
162
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
-
167
163
// 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
+ }
170
175
}
171
176
172
177
@ Test
You can’t perform that action at this time.
0 commit comments