Skip to content

Commit 0bd4945

Browse files
committed
feat: crete host method to database
Signed-off-by: Otavio Santana <[email protected]>
1 parent 121f619 commit 0bd4945

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/communication/DocumentDatabase.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ public MongoDBDocumentManager get(String database) {
4747

4848
private Settings getSettings() {
4949
Map<String,Object> settings = new HashMap<>();
50-
String host = mongodb.getHost() + ":" + mongodb.getFirstMappedPort();
51-
settings.put(MongoDBDocumentConfigurations.HOST.get()+".1", host);
50+
settings.put(MongoDBDocumentConfigurations.HOST.get()+".1", host());
5251
return Settings.of(settings);
5352
}
5453

54+
public String host() {
55+
return mongodb.getHost() + ":" + mongodb.getFirstMappedPort();
56+
}
57+
5558
}

0 commit comments

Comments
 (0)