From 06ca3f08d69cdc7b085b8fbe2042c45f6d15d05c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 09:54:07 +0000 Subject: [PATCH 1/2] Bump maven-surefire-plugin from 2.19.1 to 2.22.2 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 2.19.1 to 2.22.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-2.19.1...surefire-2.22.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa7c7b646..1e9df0b78 100644 --- a/pom.xml +++ b/pom.xml @@ -445,7 +445,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 2.22.2 ${skipUTs} From 00cb3697925e5478dbf25560ecea6abbd80e6a95 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 7 Dec 2022 17:04:38 +0000 Subject: [PATCH 2/2] need to fix mongo tests --- src/it/java/servlets/SetupIT.java | 43 ++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/it/java/servlets/SetupIT.java b/src/it/java/servlets/SetupIT.java index 44aabda3a..7aa3ceec9 100644 --- a/src/it/java/servlets/SetupIT.java +++ b/src/it/java/servlets/SetupIT.java @@ -143,7 +143,7 @@ public void testNoMysqlResource() { fail(message); } - if (authData == "") { + if (authData.equals("")) { String message = "Auth data loaded from " + Constants.SETUP_AUTH + " was empty!"; log.fatal(message); fail(message); @@ -173,4 +173,45 @@ public void testNoMysqlResource() { */ } + @Ignore + @Test + public void testNoMongodbResource() { + + log.debug("Creating Setup Servlet Instance"); + Setup servlet = new Setup(); + try { + servlet.init(new MockServletConfig("Setup")); + } catch (ServletException e) { + log.fatal(e.toString()); + fail(e.toString()); + } + + TestProperties.deleteMongoResource(); + assertTrue(Setup.isInstalled()); + + String mongodbProp = ""; + try { + mongodbProp = FileUtils.readFileToString(new File(Constants.MONGO_DB_PROP), StandardCharsets.UTF_8); + } catch (IOException e) { + String message = + "Error when loading mongodb file " + + Constants.MONGO_DB_PROP + + ". Exception message was " + + e.toString(); + log.fatal(message); + fail(message); + } + + if (mongodbProp == null) { + String message = "MongoDb data loaded from " + Constants.MONGO_DB_PROP + " was null!"; + log.fatal(message); + fail(message); + } + + if (mongodbProp.equals("")) { + String message = "MongoDb data loaded from " + Constants.MONGO_DB_PROP + " was empty!"; + log.fatal(message); + fail(message); + } + } }