Skip to content

Commit

Permalink
fix more broken tests;
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan committed Aug 31, 2022
1 parent e9632ef commit 20d9e43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ private MongoThingsSearchPersistence provideReadPersistence() {
final MongoThingsSearchPersistence result = new MongoThingsSearchPersistence(mongoClient, actorSystem, config);
// explicitly trigger CompletableFuture to make sure that indices are created before test runs
result.initializeIndices().toCompletableFuture().join();

return result;
}

Expand Down Expand Up @@ -201,6 +202,7 @@ protected ResultList<ThingId> findAll(final Query query, final List<String> subj

protected <T> T runBlockingWithReturn(final Source<T, NotUsed> publisher) {
final CompletionStage<T> done = publisher.runWith(Sink.last(), actorSystem);

return done.toCompletableFuture().join();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private <E> List<Thing> createAndPersistThings(final Collection<E> values, final

final List<Thing> things = values.stream()
.map(builderFunction)
.toList();
.collect(Collectors.toList()); // do not replace with .toList()
// shuffle the documents for more realistic testing
Collections.shuffle(things);
things.forEach(this::persistThing);
Expand Down

0 comments on commit 20d9e43

Please sign in to comment.