diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java index d7c8cde2fd4..a9e3c52c97f 100644 --- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java +++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java @@ -138,19 +138,15 @@ void serverShouldRetryToConnectToElasticSearchWhenStartService(GuiceJamesServer assertThatServerStartCorrectly(server); } - - interface StartAction { - void execute(); - } - private void waitToStartContainer(long waitingTime, StartAction action) { + private void waitToStartContainer(long waitingTime, Runnable action) { executorService.submit(() -> { try { Thread.sleep(waitingTime); } catch (InterruptedException e) { throw new RuntimeException(e); } - action.execute(); + action.run(); }); }