From a289a2cda2019a441d6d86f2da3203d2af957adc Mon Sep 17 00:00:00 2001 From: Jannik Fried Date: Wed, 11 Sep 2024 14:23:15 +0200 Subject: [PATCH 1/4] Fixes test (#441) --- .../MongoDbCollectionsTestConfig.java | 22 ++++++++++++++++++ .../component/TestMongoDbCollections.java | 23 ++++++------------- 2 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/MongoDbCollectionsTestConfig.java diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/MongoDbCollectionsTestConfig.java b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/MongoDbCollectionsTestConfig.java new file mode 100644 index 000000000..41ef118df --- /dev/null +++ b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/MongoDbCollectionsTestConfig.java @@ -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); + } +} diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestMongoDbCollections.java b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestMongoDbCollections.java index 173f7fbd9..8bb416517 100644 --- a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestMongoDbCollections.java +++ b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestMongoDbCollections.java @@ -48,13 +48,8 @@ public class TestMongoDbCollections { private static ConfigurableApplicationContext appContext; // MongoDB configuration - private static final String CONNECTION_URL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/"; - private static final String DB_NAME = "aas-env"; - private static final String AAS_REPO_COLLECTION = "aas-repo"; - private static final String SM_REPO_COLLECTION = "submodel-repo"; - private static final String CD_REPO_COLLECTION = "cd-repo"; - private static final MongoTemplate mongoTemplate = buildMongoTemplate(CONNECTION_URL, DB_NAME); + private static final MongoTemplate mongoTemplate = MongoDbCollectionsTestConfig.buildMongoTemplate(); @BeforeClass public static void startAASEnvironment() throws Exception { @@ -64,32 +59,28 @@ public static void startAASEnvironment() throws Exception { @AfterClass public static void deleteDatabase() { appContext.close(); - MongoDBUtilities.clearCollection(mongoTemplate, AAS_REPO_COLLECTION); - MongoDBUtilities.clearCollection(mongoTemplate, SM_REPO_COLLECTION); - MongoDBUtilities.clearCollection(mongoTemplate, CD_REPO_COLLECTION); + MongoDBUtilities.clearCollection(mongoTemplate, MongoDbCollectionsTestConfig.AAS_REPO_COLLECTION); + MongoDBUtilities.clearCollection(mongoTemplate, MongoDbCollectionsTestConfig.SM_REPO_COLLECTION); + MongoDBUtilities.clearCollection(mongoTemplate, MongoDbCollectionsTestConfig.CD_REPO_COLLECTION); } @Test public void aasRepoCollectionIsCorrectlyDefined() { - assertMongoDBCollectionExists(AAS_REPO_COLLECTION); + assertMongoDBCollectionExists(MongoDbCollectionsTestConfig.AAS_REPO_COLLECTION); } @Test public void smRepoCollectionIsCorrectlyDefined() { - assertMongoDBCollectionExists(SM_REPO_COLLECTION); + assertMongoDBCollectionExists(MongoDbCollectionsTestConfig.SM_REPO_COLLECTION); } @Test public void cdRepoCollectionIsCorrectlyDefined() { - assertMongoDBCollectionExists(CD_REPO_COLLECTION); + assertMongoDBCollectionExists(MongoDbCollectionsTestConfig.CD_REPO_COLLECTION); } private void assertMongoDBCollectionExists(String collectionName) { assertTrue(mongoTemplate.collectionExists(collectionName)); } - private static MongoTemplate buildMongoTemplate(String connectionUrl, String dbName) { - MongoClient client = MongoClients.create(connectionUrl); - return new MongoTemplate(client, dbName); - } } From 97586dc35af6bdb913dd9415bb6822fa15fdd51f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:52:13 +0200 Subject: [PATCH 2/4] Bump de.dfki.cos.basys.common:jsonpatch-maven-plugin from 0.5.0 to 0.5.1 (#381) Bumps de.dfki.cos.basys.common:jsonpatch-maven-plugin from 0.5.0 to 0.5.1. --- updated-dependencies: - dependency-name: de.dfki.cos.basys.common:jsonpatch-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- basyx.aasregistry/pom.xml | 2 +- basyx.submodelregistry/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basyx.aasregistry/pom.xml b/basyx.aasregistry/pom.xml index 0c3b33dbc..a7c40e41b 100644 --- a/basyx.aasregistry/pom.xml +++ b/basyx.aasregistry/pom.xml @@ -35,7 +35,7 @@ 6.6.0 0.2.6 3.0.2 - 0.5.0 + 0.5.1 patch-base-extensions.yaml diff --git a/basyx.submodelregistry/pom.xml b/basyx.submodelregistry/pom.xml index 25aeca6f7..9a59ce731 100644 --- a/basyx.submodelregistry/pom.xml +++ b/basyx.submodelregistry/pom.xml @@ -33,7 +33,7 @@ 6.6.0 0.2.6 3.0.2 - 0.5.0 + 0.5.1 patch-base-extensions.yaml From 7eb5ced299d26a56df9147382042a55cd3c0a705 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:52:56 +0200 Subject: [PATCH 3/4] Bump com.github.spullara.mustache.java:compiler from 0.9.4 to 0.9.14 (#382) Bumps [com.github.spullara.mustache.java:compiler](https://github.com/spullara/mustache.java) from 0.9.4 to 0.9.14. - [Commits](https://github.com/spullara/mustache.java/compare/mustache.java-0.9.4...mustache.java-0.9.14) --- updated-dependencies: - dependency-name: com.github.spullara.mustache.java:compiler dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- basyx.aasregistry/pom.xml | 2 +- basyx.submodelregistry/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basyx.aasregistry/pom.xml b/basyx.aasregistry/pom.xml index a7c40e41b..ce4c59025 100644 --- a/basyx.aasregistry/pom.xml +++ b/basyx.aasregistry/pom.xml @@ -30,7 +30,7 @@ 33.2.1-jre 3.9.0 3.0-alpha-2 - 0.9.4 + 0.9.14 ${project.artifactId} 6.6.0 0.2.6 diff --git a/basyx.submodelregistry/pom.xml b/basyx.submodelregistry/pom.xml index 9a59ce731..9dd36e6d1 100644 --- a/basyx.submodelregistry/pom.xml +++ b/basyx.submodelregistry/pom.xml @@ -28,7 +28,7 @@ 33.2.1-jre 3.6.0 3.0-alpha-2 - 0.9.4 + 0.9.14 ${project.artifactId} 6.6.0 0.2.6 From 51e84c6c9df29ee321a04d18ead2c963149faec3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:53:15 +0200 Subject: [PATCH 4/4] Bump org.yaml:snakeyaml from 2.2 to 2.3 (#420) Bumps [org.yaml:snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 2.2 to 2.3. - [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-2.3..snakeyaml-2.2) --- updated-dependencies: - dependency-name: org.yaml:snakeyaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0a72b611..ea8092ff2 100644 --- a/pom.xml +++ b/pom.xml @@ -351,7 +351,7 @@ org.yaml snakeyaml - 2.2 + 2.3 org.springdoc