From 7f2e3520839a322f2c659bbf2501720a84bf0635 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Thu, 20 May 2021 16:23:56 +0100 Subject: Fix tests not running after junit5 upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a conflict with the junit version in spring boot and the one in the project. With that, maven surefire plugin was not finding the tests. The org.onap.sdc.security.logging.wrappers.LoggerTest was also broken with a conflict with mockito and an undesirable powermock library from org.onap.portal.sdk:epsdk-fw artifact. There was also an incorrect assertion in the test. Issue-ID: SDC-3604 Signed-off-by: André Schmid Change-Id: Ieacedaa9c5204c2eab6ee96870f9b7726e06fc43 --- pom.xml | 57 ++++++++++++++-------- security-util-lib/pom.xml | 8 ++- .../sdc/security/logging/wrappers/LoggerTest.java | 2 +- 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index ce15272..9f46236 100644 --- a/pom.xml +++ b/pom.xml @@ -39,22 +39,24 @@ 1.8 UTF-8 UTF-8 - 2.23.4 - 5.7.1 + 2.26.0 + 5.7.2 1.5.0 2.17 + 2.22.2 + 2.22.2 snapshots releases /content/sites/site/org/onap/sdc/sdc-be-common/${project.version} https://nexus.onap.org docker docker - - - java - - ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml - + + + java + + ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml + ${project.build.sourceEncoding} true ${project.basedir} @@ -81,6 +83,25 @@ 1.18.8 provided + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.junit.jupiter + junit-jupiter-engine + test + ${junit-jupiter.version} + + + org.mockito + mockito-core + ${mockito.version} + test + org.springframework.boot spring-boot-dependencies @@ -109,26 +130,24 @@ org.junit.jupiter - junit-jupiter-api - ${junit.jupiter.version} - test - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} - test + junit-jupiter-engine org.mockito mockito-core - ${mockito.version} - test + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + maven-checkstyle-plugin ${maven-checkstyle-plugin.version} diff --git a/security-util-lib/pom.xml b/security-util-lib/pom.xml index a4eb3a7..edf71ef 100644 --- a/security-util-lib/pom.xml +++ b/security-util-lib/pom.xml @@ -107,6 +107,10 @@ slf4j-log4j12 org.slf4j + + powermock-api-mockito + org.powermock + powermock-module-junit4 org.powermock @@ -116,8 +120,8 @@ junit-jupiter-api - org.onap.aaf.authz - aaf-cadi-aaf + org.onap.aaf.authz + aaf-cadi-aaf aaf-cadi-core diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java index 731bf5e..8047845 100644 --- a/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java @@ -64,7 +64,7 @@ public class LoggerTest { @Test public void getName() { - assertEquals("Logger name not as expected", "org.onap.sdc.security.logging.wrappers.LoggerTest", log.getName()); + assertEquals("org.onap.sdc.security.logging.wrappers.LoggerTest", log.getName(), "Logger name not as expected"); } @Test -- cgit 1.2.3-korg