vy opened a new pull request, #1471:
URL: https://github.com/apache/logging-log4j2/pull/1471
Adds `Log4jEventRecorder` et al. which provides JUnit 5 test-method-scoped
`LoggerContext`s which can be used as follows:
```
@Log4jEventRecorderEnabled
class FooTest {
@Test
void exceptions_should_get_logged(Log4jEventRecorder log4jEventRecorder)
{
// Execute the logic
Logger logger =
log4jEventRecorder.getLoggerContext().getLogger(Foo.class);
new Foo(logger).runBusinessLogic(...);
// Verify the logging
List<LogEvent> events = log4jEventRecorder.getEvents();
// ...
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]