Skip to content

Commit 9cca4ff

Browse files
author
mpv1989
committed
Fix test
1 parent 137576c commit 9cca4ff

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/test/java/com/arangodb/ArangoCollectionTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ public void deleteIndexByKey() throws InterruptedException, ExecutionException {
802802

803803
@Test
804804
public void createHashIndex() throws InterruptedException, ExecutionException {
805+
final boolean singleServer = arangoDB.getRole().get() == ServerRole.SINGLE;
805806
final Collection<String> fields = new ArrayList<>();
806807
fields.add("a");
807808
fields.add("b");
@@ -816,11 +817,8 @@ public void createHashIndex() throws InterruptedException, ExecutionException {
816817
assertThat(indexResult.getId(), startsWith(COLLECTION_NAME));
817818
assertThat(indexResult.getIsNewlyCreated(), is(true));
818819
assertThat(indexResult.getMinLength(), is(nullValue()));
819-
try {
820-
if (arangoDB.getRole().get() == ServerRole.SINGLE) {
821-
assertThat(indexResult.getSelectivityEstimate(), is(1));
822-
}
823-
} catch (InterruptedException | ExecutionException e) {
820+
if (singleServer) {
821+
assertThat(indexResult.getSelectivityEstimate(), is(1));
824822
}
825823
assertThat(indexResult.getSparse(), is(false));
826824
assertThat(indexResult.getType(), is(IndexType.hash));

0 commit comments

Comments
 (0)