You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ra...@apache.org on 2026/05/31 12:11:36 UTC
(logging-log4j2) 22/22: Enhance WebLookupTest to assert CompositeConfiguration for comma-separated configurations
This is an automated email from the ASF dual-hosted git repository.
ramanathan1504 pushed a commit to branch ramanathan1504-issue-2351
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 74eee48fc17c5ddea77a2acb3dfbfef67bb473b4
Author: Ramanathan <ra...@gmail.com>
AuthorDate: Sun May 31 17:40:10 2026 +0530
Enhance WebLookupTest to assert CompositeConfiguration for comma-separated configurations
---
.../test/java/org/apache/logging/log4j/web/WebLookupTest.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/log4j-jakarta-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java b/log4j-jakarta-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
index d14d6fb95a..a982ff9006 100644
--- a/log4j-jakarta-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
+++ b/log4j-jakarta-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.logging.log4j.web;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import jakarta.servlet.ServletContext;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.composite.CompositeConfiguration;
import org.apache.logging.log4j.core.impl.ContextAnchor;
import org.apache.logging.log4j.core.lookup.StrSubstitutor;
import org.junit.jupiter.api.AfterEach;
@@ -156,7 +156,10 @@ public class WebLookupTest {
final Configuration config = ctx.getConfiguration();
assertNotNull(config, "No Configuration");
-
+ assertInstanceOf(
+ CompositeConfiguration.class,
+ config,
+ "Expected CompositeConfiguration for comma-separated log4jConfiguration");
final StrSubstitutor substitutor = config.getStrSubstitutor();
assertNotNull(substitutor, "No StrSubstitutor");