Class LoggerAuditingExtension
- java.lang.Object
-
- org.apache.flink.testutils.logging.LoggerAuditingExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
public class LoggerAuditingExtension extends Object implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
Utility for auditing logged messages.(Junit5 extension)Implementation note: Make sure to not expose log4j dependencies in the interface of this class to ease updates in logging infrastructure.
-
-
Constructor Summary
Constructors Constructor Description LoggerAuditingExtension(Class<?> clazz, org.slf4j.event.Level level)
LoggerAuditingExtension(String loggerName, org.slf4j.event.Level level)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
List<org.apache.logging.log4j.core.LogEvent>
getEvents()
String
getLoggerName()
List<String>
getMessages()
-
-
-
Method Detail
-
getEvents
public List<org.apache.logging.log4j.core.LogEvent> getEvents()
-
getLoggerName
public String getLoggerName()
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
Exception
-
-