Skip to content

Commit

Permalink
Added a UnitTest for the TriggerOnErrorOrWorseLogAppender.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-Draeger committed Nov 28, 2024
1 parent 5f44c72 commit e0a7724
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ public void testAppend(Level level, boolean expectHandlerCall) {
Filter filter = mock(Filter.class);
TriggerOnErrorOrWorseLogAppender classUnderTest = new TriggerOnErrorOrWorseLogAppender("log",
filter);
classUnderTest.setOnErrorOrWorseHandler(new TriggerOnErrorOrWorseLogAppender.OnErrorOrWorseHandler() {
@Override
public void onErrorOrWorse(LogEvent event) {
flag.set(true);
}
});
classUnderTest.setOnErrorOrWorseHandler((LogEvent event) -> flag.set(true));
LogEvent event = mock(LogEvent.class);
when(event.getLevel()).thenReturn(level);

Expand Down

0 comments on commit e0a7724

Please sign in to comment.