Package org.mongounit

Class DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder

java.lang.Object
org.mongounit.DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder
Enclosing class:
DatasetGeneratorArguments

public static class DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder extends Object
  • Method Details

    • mongoClientURI

      public DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder mongoClientURI(com.mongodb.MongoClientURI mongoClientURI)
      Parameters:
      mongoClientURI - Validated URI of the mongo DB to connect to.
      Returns:
      Instance of this builder class.
    • collectionNames

      public DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder collectionNames(List<String> collectionNames)
      Parameters:
      collectionNames - Optional list of collection names to generate data based on.
      Returns:
      Instance of this builder class.
    • outputPath

      Parameters:
      outputPath - Absolute path to file where to output JSON.
      Returns:
      Instance of this builder class.
    • preserveBsonTypes

      public DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder preserveBsonTypes(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.
      Returns:
      Instance of this builder class.
    • mongoUnitValueFieldNameIndicator

      public DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder mongoUnitValueFieldNameIndicator(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.
      Returns:
      Instance of this builder class.
    • build

      public DatasetGeneratorArguments build()
      Returns:
      New instance of the DatasetGeneratorArguments class with the previously set properties.
    • toString

      public String toString()
      Overrides:
      toString in class Object