Skip to content

Commit 0954c44

Browse files
committed
Omit stack trace from invalid lifecycle mode warning
1 parent 01d4ff5 commit 0954c44

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package org.junit.jupiter.engine.descriptor;
1212

13-
import static java.util.logging.Level.WARNING;
1413
import static org.junit.jupiter.engine.Constants.DEFAULT_TEST_INSTANCE_LIFECYCLE_PROPERTY_NAME;
1514

1615
import java.util.Optional;
@@ -69,11 +68,10 @@ static TestInstance.Lifecycle getDefaultTestInstanceLifecycle(ConfigurationParam
6968
catch (Exception ex) {
7069
// local copy necessary for use in lambda expression
7170
String constant = constantName;
72-
logger.log(WARNING, ex,
73-
() -> String.format(
74-
"Invalid test instance lifecycle mode '%s' set via the '%s' configuration parameter. "
75-
+ "Falling back to %s lifecycle semantics.",
76-
constant, propertyName, Lifecycle.PER_METHOD.name()));
71+
logger.warning(() -> String.format(
72+
"Invalid test instance lifecycle mode '%s' set via the '%s' configuration parameter. "
73+
+ "Falling back to %s lifecycle semantics.",
74+
constant, propertyName, Lifecycle.PER_METHOD.name()));
7775
}
7876
}
7977

0 commit comments

Comments
 (0)