This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push:
new c472738e56 Fix `log4j-api-test` effective dependencies
c472738e56 is described below
commit c472738e564e98ea9a692db3415785703d52b221
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri Oct 20 11:57:05 2023 +0200
Fix `log4j-api-test` effective dependencies
The module lost Mockito after #1835 was merged.
---
log4j-api-test/pom.xml | 58 +++++++++++++++++-----
.../logging/log4j/message/MapMessageTest.java | 9 ++--
log4j-parent/pom.xml | 6 +++
3 files changed, 56 insertions(+), 17 deletions(-)
diff --git a/log4j-api-test/pom.xml b/log4j-api-test/pom.xml
index dcc923a3e2..3a9a1bf092 100644
--- a/log4j-api-test/pom.xml
+++ b/log4j-api-test/pom.xml
@@ -43,6 +43,7 @@
org.junitpioneer.*;resolution:=optional,
org.apache.maven.*;resolution:=optional,
org.codehaus.plexus.util.*;resolution:=optional,
+ org.mockito.*;resolution:=optional
</bnd-extra-package-options>
<bnd-extra-module-options>
<!-- Non-transitive static modules -->
@@ -57,12 +58,16 @@
plexus.utils;substitute="plexus-utils";transitive=false;static=true
</bnd-extra-module-options>
</properties>
+ <!--
+ ~ The dependency list has been checked with:
+ ~
+ ~ ./mvnw dependency:analyze -pl log4j-api-test
+ ~
+ ~ False positives:
+ ~ org.junit.platform:junit-platform-engine
+ ~ It is used in StackLocatorUtilTest through a Class.forName
+ -->
<dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
@@ -71,6 +76,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -79,19 +88,26 @@
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-commons</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
@@ -111,7 +127,7 @@
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-migrationsupport</artifactId>
+ <artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -120,8 +136,24 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-inline</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- Used by ServiceLoaderUtilTest -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.webcompere</groupId>
+ <artifactId>system-stubs-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git
a/log4j-api-test/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
b/log4j-api-test/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
index 70e1c258da..6ffcfe643d 100644
---
a/log4j-api-test/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
+++
b/log4j-api-test/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
@@ -26,11 +26,12 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import com.google.common.base.Strings;
+import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.StringBuilderFormattable;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
*
@@ -178,8 +179,8 @@ public class MapMessageTest {
final int depth = MapMessageJsonFormatter.MAX_DEPTH - 2;
final String expectedJson = String
.format("{'key':%s1%s}",
- Strings.repeat("[", depth),
- Strings.repeat("]", depth))
+ StringUtils.repeat("[", depth),
+ StringUtils.repeat("]", depth))
.replace('\'', '"');
final String actualJson = testJsonFormatterMaxDepth(depth);
assertEquals(expectedJson, actualJson);
diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml
index f3e71d18d5..6d5b2b460c 100644
--- a/log4j-parent/pom.xml
+++ b/log4j-parent/pom.xml
@@ -835,6 +835,12 @@
<version>${maven.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-core</artifactId>