Skip to content

Commit a42c9ea

Browse files
committed
Add test for empty logger parent name
Import assertNull and add an assertion verifying that Logging.getParentLoggerName("") returns null. This ensures the logging implementation correctly handles an empty logger name case in tests.
1 parent 67286fb commit a42c9ea

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • microsphere-logging-commons/src/test/java/io/microsphere/logging

microsphere-logging-commons/src/test/java/io/microsphere/logging/LoggingTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static io.microsphere.logging.DefaultLoggingLevelsResolverTest.JAVA_LOGGING_LEVELS;
2626
import static io.microsphere.logging.LoggingUtils.load;
2727
import static org.junit.jupiter.api.Assertions.assertEquals;
28+
import static org.junit.jupiter.api.Assertions.assertNull;
2829

2930
/**
3031
* {@link Logging} Test
@@ -80,6 +81,7 @@ void testGetParentLoggerName() {
8081
assertEquals("com.acme", this.logging.getParentLoggerName("com.acme.Test"));
8182
assertEquals("com", this.logging.getParentLoggerName("com.acme"));
8283
assertEquals("", this.logging.getParentLoggerName("com"));
84+
assertNull(this.logging.getParentLoggerName(""));
8385
}
8486

8587
@Test
@@ -92,4 +94,4 @@ void testGetPriority() {
9294
assertEquals(MAX_PRIORITY, this.logging.getPriority());
9395
}
9496

95-
}
97+
}

0 commit comments

Comments
 (0)