Consistently log exceptions from TestExecutionListeners at WARN level

Prior to this commit, the TestContextManager logged an exception from a
TestExecutionListener at WARN level except in prepareTestInstance()
where such an exception was logged at ERROR level (except for a skipped
exception which is logged at INFO level).

For consistency, this commit modifies TestContextManager so that it
always logs non-skipped exceptions from TestExecutionListeners at WARN
level.

Closes gh-31688
This commit is contained in:
Sam Brannen 2023-11-26 12:44:06 +01:00
parent b17f3bc07b
commit 97264c77dd
1 changed files with 2 additions and 2 deletions

View File

@ -268,8 +268,8 @@ public class TestContextManager {
.formatted(typeName(testExecutionListener), testInstance), ex);
}
}
else if (logger.isErrorEnabled()) {
logger.error("""
else if (logger.isWarnEnabled()) {
logger.warn("""
Caught exception while allowing TestExecutionListener [%s] to \
prepare test instance [%s]"""
.formatted(typeName(testExecutionListener), testInstance), ex);