Class EmbeddedMongoDB

java.lang.Object
de.svenkubiak.embeddedmongodb.EmbeddedMongoDB

public class EmbeddedMongoDB extends Object
  • Constructor Details

    • EmbeddedMongoDB

      public EmbeddedMongoDB()
  • Method Details

    • create

      public static EmbeddedMongoDB create()
      Creates a new EmbeddedMongoDB instance
      Returns:
      EmbeddedMongoDB instance
    • withPort

      public EmbeddedMongoDB withPort(int port)
      Sets the port for the EmbeddedMongoDB instance Default is 29019
      Parameters:
      port - The port to set
      Returns:
      EmbeddedMongoDB instance
    • withHost

      public EmbeddedMongoDB withHost(String host)
      Sets the host for the EmbeddedMongoDB instance Default is localhost
      Parameters:
      host - The host to set
      Returns:
      EmbeddedMongoDB instance
    • enableIPv6

      public EmbeddedMongoDB enableIPv6()
      Enable IPv6 for host configuration Default is false
      Returns:
      EmbeddedMongoDB instance
    • withVersion

      public EmbeddedMongoDB withVersion(de.flapdoodle.embed.mongo.distribution.Version.Main version)
      Sets the version for the EmbeddedMongoDB instance Default is Version.Main.V6_0
      Parameters:
      version - The version to set
      Returns:
      EmbeddedMongoDB instance
    • start

      public EmbeddedMongoDB start()
      Starts the EmbeddedMongoDB instance
      Returns:
      EmbeddedMongoDB instance
    • stop

      public void stop()
      Stops the EmbeddedMongoDB instance
    • getHost

      public String getHost()
      Returns:
      The configured host name
    • getVersion

      public de.flapdoodle.embed.mongo.distribution.Version.Main getVersion()
      Returns:
      The mongod version in use
    • getPort

      public int getPort()
      Returns:
      The configured port
    • isActive

      public boolean isActive()
      Returns:
      True if embedded database is up and running, false otherwise
    • isIPv6

      public boolean isIPv6()
      Returns:
      True if IPv6 is enabled, false otherwise