File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/test/java/net/logstash/logback/appender Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1616package net .logstash .logback .appender ;
1717
1818import static org .assertj .core .api .Assertions .assertThat ;
19+ import static org .awaitility .Awaitility .await ;
1920import static org .mockito .Mockito .doThrow ;
2021import static org .mockito .Mockito .inOrder ;
2122import static org .mockito .Mockito .mock ;
2930import java .io .Flushable ;
3031import java .io .IOException ;
3132import java .io .OutputStream ;
33+ import java .time .Duration ;
3234
3335import net .logstash .logback .appender .listener .AppenderListener ;
3436
@@ -215,7 +217,11 @@ public void flushWithNullOutputStream() {
215217 outputStreamDelegate .setOutputStream (null );
216218 appender .doAppend (event );
217219
218- assertThat (appender .getStatusManager ().getCount ()).isZero ();
220+ verify (outputStreamDelegate , timeout (VERIFICATION_TIMEOUT )).doAppend (event );
221+
222+ await ()
223+ .timeout (Duration .ofMillis (VERIFICATION_TIMEOUT ))
224+ .untilAsserted (() -> assertThat (appender .getStatusManager ().getCount ()).isEqualTo (1 ));
219225 }
220226
221227
You can’t perform that action at this time.
0 commit comments