+
+ protected static <T> T waitOnAsyncTask(final CompletionStage<T> completionStage, final Duration timeout)
+ throws Exception {
+ return Await.result(FutureConverters.toScala(completionStage), timeout);
+ }
+
+ @After
+ public void actorSystemCleanup() {
+ for (final ActorSystem system : actorSystems) {
+ JavaTestKit.shutdownActorSystem(system, null, Boolean.TRUE);
+ }
+ }
+
+ protected ActorSystem newActorSystem(String name, String config) {
+ ActorSystem system = ActorSystem.create(name, ConfigFactory.load().getConfig(config));
+ actorSystems.add(system);
+ return system;
+ }