Package org.mongounit
Class DatasetGeneratorArguments
java.lang.Object
org.mongounit.DatasetGeneratorArguments
DatasetGeneratorArguments
class represents all arguments passed into the DatasetGenerator
standalone program.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DatasetGeneratorArguments.DatasetGeneratorArgumentsBuilder
class is a builder pattern class for theDatasetGeneratorArguments
class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
com.mongodb.MongoClientURI
int
hashCode()
void
setCollectionNames
(List<String> collectionNames) void
setMongoClientURI
(com.mongodb.MongoClientURI mongoClientURI) void
setMongoUnitValueFieldNameIndicator
(String mongoUnitValueFieldNameIndicator) void
setOutputPath
(String outputPath) void
setPreserveBsonTypes
(List<String> preserveBsonTypes) toString()
-
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 theBsonType
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 inBsonType
. 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
- Returns:
- Optional list of collection names to generate data based on.
-
getOutputPath
- Returns:
- Absolute path to file where to output JSON.
-
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
- 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
- Parameters:
collectionNames
- Optional list of collection names to generate data based on.
-
setOutputPath
- Parameters:
outputPath
- Absolute path to file where to output JSON.
-
setPreserveBsonTypes
- Parameters:
preserveBsonTypes
- List of BSON types to generate explicit MongoUnit BSON type specification. The specification is based on the names (not values) of theBsonType
enum.
-
setMongoUnitValueFieldNameIndicator
- 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 inBsonType
. 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
-
hashCode
public int hashCode() -
toString
-