Class EmbeddedMongo

java.lang.Object
org.ikasan.component.endpoint.mongo.test.EmbeddedMongo

public class EmbeddedMongo extends Object
Allows the port and download location of the mongo distribution to be configured Also ensures that only a single embedded mongo instance is started for all tests
Author:
Kieron Edwards
  • Constructor Details

    • EmbeddedMongo

      @Deprecated public EmbeddedMongo(int port)
      Deprecated.
      - use the configuration object constructor or the empty constructor instead
    • EmbeddedMongo

      public EmbeddedMongo()
      This will automatically allocated a free port to the mongo instance
    • EmbeddedMongo

      public EmbeddedMongo(EmbeddedMongoConfiguration configuration)
      If you need to configure embedded mongo distribution and db settings use this constructor
  • Method Details

    • start

      public com.mongodb.client.MongoClient start()
      This will check for the singleton instance and wont instantiate a new mongo database each time start is called by a test.
      Returns:
    • stop

      public static void stop()
    • getConfiguration

      public EmbeddedMongoConfiguration getConfiguration()