diff --git a/metis-common/metis-common-mongo/src/main/java/eu/europeana/metis/mongo/embedded/EmbeddedLocalhostMongo.java b/metis-common/metis-common-mongo/src/main/java/eu/europeana/metis/mongo/embedded/EmbeddedLocalhostMongo.java index 7d97e052c..9fbe17a1a 100644 --- a/metis-common/metis-common-mongo/src/main/java/eu/europeana/metis/mongo/embedded/EmbeddedLocalhostMongo.java +++ b/metis-common/metis-common-mongo/src/main/java/eu/europeana/metis/mongo/embedded/EmbeddedLocalhostMongo.java @@ -15,11 +15,10 @@ import de.flapdoodle.reverse.TransitionWalker; import de.flapdoodle.reverse.transitions.Start; import eu.europeana.metis.network.NetworkUtil; +import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; - /** * Starts an in memory Mongo database. This class is to be used for unit testing on localhost. */ @@ -29,15 +28,15 @@ public class EmbeddedLocalhostMongo { private static final String DEFAULT_MONGO_HOST = "127.0.0.1"; private static final ImmutableProcessOutput processOutput = ProcessOutput.builder() - .commands(Processors.logTo(LOGGER, Slf4jLevel.DEBUG)) - .output(Processors.logTo(LOGGER, Slf4jLevel.INFO)) - .error(Processors.logTo(LOGGER, Slf4jLevel.ERROR)) - .build(); + .commands(Processors.logTo(LOGGER, Slf4jLevel.DEBUG)) + .output(Processors.logTo(LOGGER, Slf4jLevel.INFO)) + .error(Processors.logTo(LOGGER, Slf4jLevel.ERROR)) + .build(); private static final ImmutableMongodArguments mongodArguments = MongodArguments.defaults() - .withSyncDelay(0) - .withStorageEngine("ephemeralForTest") - .withUseNoJournal(true); + .withSyncDelay(0) + .withStorageEngine("ephemeralForTest") + .withUseNoJournal(true); private TransitionWalker.ReachedState runningMongodProcessReachedState; private int mongoPort; @@ -57,9 +56,10 @@ public void start() { try { mongoPort = new NetworkUtil().getAvailableLocalPort(); ImmutableMongod mongod = Mongod.instance() - .withNet(Start.to(Net.class).initializedWith(Net.builder().bindIp(DEFAULT_MONGO_HOST).port(mongoPort).isIpv6(true).build())) - .withProcessOutput(Start.to(ProcessOutput.class).initializedWith(processOutput)) - .withMongodArguments(Start.to(MongodArguments.class).initializedWith(mongodArguments)); + .withNet(Start.to(Net.class).initializedWith( + Net.builder().bindIp(DEFAULT_MONGO_HOST).port(mongoPort).isIpv6(true).build())) + .withProcessOutput(Start.to(ProcessOutput.class).initializedWith(processOutput)) + .withMongodArguments(Start.to(MongodArguments.class).initializedWith(mongodArguments)); runningMongodProcessReachedState = mongod.start(Version.Main.V4_4);