summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-05-20 16:23:56 +0100
committerandre.schmid <andre.schmid@est.tech>2021-05-20 16:23:56 +0100
commit7f2e3520839a322f2c659bbf2501720a84bf0635 (patch)
tree5b8ee9ca0f9c2399b3bcf362fb188cc5f9e224f9
parentd9390c23f8568c4df7797eb321161cef725221b0 (diff)
Fix tests not running after junit5 upgrade
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 <andre.schmid@est.tech> Change-Id: Ieacedaa9c5204c2eab6ee96870f9b7726e06fc43
-rw-r--r--pom.xml57
-rw-r--r--security-util-lib/pom.xml8
-rw-r--r--security-util-lib/src/test/java/org/onap/sdc/security/logging/wrappers/LoggerTest.java2
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 @@
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <mockito.version>2.23.4</mockito.version>
- <junit.jupiter.version>5.7.1</junit.jupiter.version>
+ <mockito.version>2.26.0</mockito.version>
+ <junit-jupiter.version>5.7.2</junit-jupiter.version>
<logging-slf4j.version>1.5.0</logging-slf4j.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
+ <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
<snapshots.path>snapshots</snapshots.path>
<releases.path>releases</releases.path>
<sitePath>/content/sites/site/org/onap/sdc/sdc-be-common/${project.version}</sitePath>
<nexus.proxy>https://nexus.onap.org</nexus.proxy>
<docker.username>docker</docker.username>
<docker.password>docker</docker.password>
-
- <!-- Sonar properties -->
- <sonar.language>java</sonar.language>
- <sonar.coverage.jacoco.xmlReportPaths>
- ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
- </sonar.coverage.jacoco.xmlReportPaths>
+
+ <!-- Sonar properties -->
+ <sonar.language>java</sonar.language>
+ <sonar.coverage.jacoco.xmlReportPaths>
+ ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
+ </sonar.coverage.jacoco.xmlReportPaths>
<sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding>
<sonar.skipDesign>true</sonar.skipDesign>
<sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
@@ -82,6 +84,25 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.junit</groupId>
+ <artifactId>junit-bom</artifactId>
+ <version>${junit-jupiter.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ <version>${junit-jupiter.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockito.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.18.RELEASE</version>
@@ -109,27 +130,25 @@
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <version>${junit.jupiter.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>${junit.jupiter.version}</version>
- <scope>test</scope>
+ <artifactId>junit-jupiter-engine</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>${mockito.version}</version>
- <scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin.version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${maven-failsafe-plugin.version}</version>
+ </plugin>
+ <plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
</plugin>
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
@@ -108,6 +108,10 @@
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
+ <artifactId>powermock-api-mockito</artifactId>
+ <groupId>org.powermock</groupId>
+ </exclusion>
+ <exclusion>
<artifactId>powermock-module-junit4</artifactId>
<groupId>org.powermock</groupId>
</exclusion>
@@ -116,8 +120,8 @@
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
<exclusion>
- <groupId> org.onap.aaf.authz</groupId>
- <artifactId> aaf-cadi-aaf</artifactId>
+ <groupId>org.onap.aaf.authz</groupId>
+ <artifactId>aaf-cadi-aaf</artifactId>
</exclusion>
<exclusion>
<artifactId>aaf-cadi-core</artifactId>
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