File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/test/java/org/soujava/demos/mongodb/document Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 8
8
import org .eclipse .jnosql .databases .mongodb .communication .MongoDBDocumentConfigurations ;
9
9
import org .eclipse .jnosql .databases .mongodb .communication .MongoDBDocumentManager ;
10
10
import org .eclipse .jnosql .databases .mongodb .communication .MongoDBDocumentManagerFactory ;
11
+ import org .eclipse .jnosql .mapping .core .config .MappingConfigurations ;
11
12
import org .testcontainers .containers .GenericContainer ;
12
13
import org .testcontainers .containers .wait .strategy .Wait ;
13
14
@@ -31,16 +32,17 @@ public MongoClient mongoClient() {
31
32
}
32
33
33
34
public MongoDBDocumentManager get (String database ) {
34
- Settings settings = getSettings ();
35
+ Settings settings = getSettings (database );
35
36
MongoDBDocumentConfiguration configuration = new MongoDBDocumentConfiguration ();
36
37
MongoDBDocumentManagerFactory factory = configuration .apply (settings );
37
38
return factory .apply (database );
38
39
}
39
40
40
41
41
- private Settings getSettings () {
42
+ private Settings getSettings (String database ) {
42
43
Map <String ,Object > settings = new HashMap <>();
43
44
settings .put (MongoDBDocumentConfigurations .HOST .get ()+".1" , host ());
45
+ settings .put (MappingConfigurations .DOCUMENT_DATABASE .get (), database );
44
46
return Settings .of (settings );
45
47
}
46
48
You can’t perform that action at this time.
0 commit comments