-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a4b9cc
commit a289a2c
Showing
2 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
.../org/eclipse/digitaltwin/basyx/aasenvironment/component/MongoDbCollectionsTestConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.eclipse.digitaltwin.basyx.aasenvironment.component; | ||
|
||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.client.MongoClients; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.mongodb.core.MongoTemplate; | ||
|
||
@Configuration | ||
public class MongoDbCollectionsTestConfig { | ||
protected static final String CONNECTION_URL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/"; | ||
protected static final String DB_NAME = "aas-env"; | ||
protected static final String AAS_REPO_COLLECTION = "aas-repo"; | ||
protected static final String SM_REPO_COLLECTION = "submodel-repo"; | ||
protected static final String CD_REPO_COLLECTION = "cd-repo"; | ||
|
||
@Bean | ||
public static MongoTemplate buildMongoTemplate() { | ||
MongoClient client = MongoClients.create(CONNECTION_URL); | ||
return new MongoTemplate(client, DB_NAME); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters