Skip to content

Commit 78ad0d1

Browse files
author
mpv1989
committed
Fix tests
1 parent 12a729c commit 78ad0d1

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ public void createFulltextIndex() throws InterruptedException, ExecutionExceptio
871871
public void getIndexes() throws InterruptedException, ExecutionException {
872872
final Collection<String> fields = new ArrayList<>();
873873
fields.add("a");
874-
db.collection(COLLECTION_NAME).createHashIndex(fields, null);
874+
db.collection(COLLECTION_NAME).createHashIndex(fields, null).get();
875875
final CompletableFuture<Collection<IndexEntity>> f = db.collection(COLLECTION_NAME).getIndexes();
876876
assertThat(f, is(notNullValue()));
877877
final Collection<IndexEntity> indexes = f.get();

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void createCollectionWithReplicationFactor() throws InterruptedException,
129129
assertThat(result.getId(), is(notNullValue()));
130130
assertThat(db.collection(COLLECTION_NAME).getProperties().get().getReplicationFactor(), is(2));
131131
} finally {
132-
db.collection(COLLECTION_NAME).drop();
132+
db.collection(COLLECTION_NAME).drop().get();
133133
}
134134
}
135135

@@ -145,7 +145,7 @@ public void createCollectionWithNumberOfShards() throws InterruptedException, Ex
145145
assertThat(result.getId(), is(notNullValue()));
146146
assertThat(db.collection(COLLECTION_NAME).getProperties().get().getNumberOfShards(), is(2));
147147
} finally {
148-
db.collection(COLLECTION_NAME).drop();
148+
db.collection(COLLECTION_NAME).drop().get();
149149
}
150150
}
151151

@@ -164,7 +164,7 @@ public void createCollectionWithNumberOfShardsAndShardKey() throws InterruptedEx
164164
assertThat(properties.getNumberOfShards(), is(2));
165165
assertThat(properties.getShardKeys().size(), is(1));
166166
} finally {
167-
db.collection(COLLECTION_NAME).drop();
167+
db.collection(COLLECTION_NAME).drop().get();
168168
}
169169
}
170170

@@ -182,7 +182,7 @@ public void createCollectionWithNumberOfShardsAndShardKeys() throws InterruptedE
182182
assertThat(properties.getNumberOfShards(), is(2));
183183
assertThat(properties.getShardKeys().size(), is(2));
184184
} finally {
185-
db.collection(COLLECTION_NAME).drop();
185+
db.collection(COLLECTION_NAME).drop().get();
186186
}
187187
}
188188

@@ -751,7 +751,7 @@ public void getAndClearSlowQueries() throws InterruptedException, ExecutionExcep
751751
final QueryEntity queryEntity = slowQueries.iterator().next();
752752
assertThat(queryEntity.getQuery(), is("return sleep(1.1)"));
753753

754-
db.clearSlowQueries();
754+
db.clearSlowQueries().get();
755755
assertThat(db.getSlowQueries().get().size(), is(0));
756756
} finally {
757757
properties.setSlowQueryThreshold(slowQueryThreshold);
@@ -853,29 +853,29 @@ public void transactionVPack() throws VPackException, InterruptedException, Exec
853853
}
854854

855855
@Test
856-
public void transactionEmpty() {
857-
db.transaction("function () {}", null, null);
856+
public void transactionEmpty() throws InterruptedException, ExecutionException {
857+
db.transaction("function () {}", null, null).get();
858858
}
859859

860860
@Test
861-
public void transactionallowImplicit() {
861+
public void transactionallowImplicit() throws InterruptedException, ExecutionException {
862862
try {
863-
db.createCollection("someCollection", null);
864-
db.createCollection("someOtherCollection", null);
863+
db.createCollection("someCollection", null).get();
864+
db.createCollection("someOtherCollection", null).get();
865865
final String action = "function (params) {" + "var db = require('internal').db;"
866866
+ "return {'a':db.someCollection.all().toArray()[0], 'b':db.someOtherCollection.all().toArray()[0]};"
867867
+ "}";
868868
final TransactionOptions options = new TransactionOptions().readCollections("someCollection");
869-
db.transaction(action, VPackSlice.class, options);
869+
db.transaction(action, VPackSlice.class, options).get();
870870
try {
871871
options.allowImplicit(false);
872872
db.transaction(action, VPackSlice.class, options).get();
873873
fail();
874874
} catch (final Exception e) {
875875
}
876876
} finally {
877-
db.collection("someCollection").drop();
878-
db.collection("someOtherCollection").drop();
877+
db.collection("someCollection").drop().get();
878+
db.collection("someOtherCollection").drop().get();
879879
}
880880
}
881881

0 commit comments

Comments
 (0)