Package org.mongounit

Class DatasetGeneratorArguments

java.lang.Object
org.mongounit.DatasetGeneratorArguments

public class DatasetGeneratorArguments extends Object
DatasetGeneratorArguments class represents all arguments passed into the DatasetGenerator standalone program.
  • Constructor Details

    • DatasetGeneratorArguments

      public DatasetGeneratorArguments()
      Default constructor.
    • DatasetGeneratorArguments

      public DatasetGeneratorArguments(com.mongodb.MongoClientURI mongoClientURI, List<String> collectionNames, String outputPath, List<String> preserveBsonTypes, String mongoUnitValueFieldNameIndicator)
      Constructor.
      Parameters:
      mongoClientURI - Validated URI of the mongo DB to connect to.
      collectionNames - Optional list of collection names to generate data based on.
      outputPath - Absolute path to file where to output JSON.
      preserveBsonTypes - List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of the BsonType enum.
      mongoUnitValueFieldNameIndicator - Field name to use as an indicator in developer JSON files to signify that a document is a representation of a special MongoUnit value. The general format of the special name/value pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to specify a BSON type value based on the naming in BsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
  • Method Details

    • builder

      Returns:
      Instance of the builder pattern version of the DatasetGeneratorArguments class.
    • getMongoClientURI

      public com.mongodb.MongoClientURI getMongoClientURI()
      Returns:
      Validated URI of the mongo DB to connect to.
    • getCollectionNames

      public List<String> getCollectionNames()
      Returns:
      Optional list of collection names to generate data based on.
    • getOutputPath

      public String getOutputPath()
      Returns:
      Absolute path to file where to output JSON.
    • getPreserveBsonTypes

      public List<String> getPreserveBsonTypes()
      Returns:
      List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of the BsonType enum.
    • getMongoUnitValueFieldNameIndicator

      public String getMongoUnitValueFieldNameIndicator()
      Returns:
      Field name to use as an indicator in developer JSON files to signify that a document is a representation of a special MongoUnit value. The general format of the special name/value pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to specify a BSON type value based on the naming in BsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
    • setMongoClientURI

      public void setMongoClientURI(com.mongodb.MongoClientURI mongoClientURI)
      Parameters:
      mongoClientURI - Validated URI of the mongo DB to connect to.
    • setCollectionNames

      public void setCollectionNames(List<String> collectionNames)
      Parameters:
      collectionNames - Optional list of collection names to generate data based on.
    • setOutputPath

      public void setOutputPath(String outputPath)
      Parameters:
      outputPath - Absolute path to file where to output JSON.
    • setPreserveBsonTypes

      public void setPreserveBsonTypes(List<String> preserveBsonTypes)
      Parameters:
      preserveBsonTypes - List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of the BsonType enum.
    • setMongoUnitValueFieldNameIndicator

      public void setMongoUnitValueFieldNameIndicator(String mongoUnitValueFieldNameIndicator)
      Parameters:
      mongoUnitValueFieldNameIndicator - Field name to use as an indicator in developer JSON files to signify that a document is a representation of a special MongoUnit value. The general format of the special name/value pair is "$$BSON_TYPE": value If the JSON is meant to seed the database, 'BSON_TYPE' is to specify a BSON type value based on the naming in BsonType. If the JSON is meant to assert the expected result state, the format is allowed to be simply: "$$": value. In addition, a 'comparator' field is expected as a sibling field name.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object