@@ -193,9 +193,15 @@ public void testFlushLevelConfigSupportsFlushLevelOff() {
193193 assertThat (foundSeverity ).isEqualTo (null );
194194 }
195195
196+ @ Test
197+ public void testDefaultFlushLevelOff () {
198+ loggingAppender .start ();
199+ Severity foundSeverity = logging .getFlushSeverity ();
200+ assertThat (foundSeverity ).isEqualTo (null );
201+ }
202+
196203 @ Test
197204 public void testFilterLogsOnlyLogsAtOrAboveLogLevel () {
198- logging .setFlushSeverity (Severity .ERROR );
199205 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
200206 logging .write (
201207 capture (capturedArgument ),
@@ -223,7 +229,6 @@ public void testFilterLogsOnlyLogsAtOrAboveLogLevel() {
223229
224230 @ Test
225231 public void testPartialSuccessOverrideHasExpectedValue () {
226- logging .setFlushSeverity (Severity .ERROR );
227232 Capture <WriteOption > logNameArg = Capture .newInstance ();
228233 Capture <WriteOption > resourceArg = Capture .newInstance ();
229234 Capture <WriteOption > partialSuccessArg = Capture .newInstance ();
@@ -247,7 +252,6 @@ public void testPartialSuccessOverrideHasExpectedValue() {
247252
248253 @ Test
249254 public void testDefaultWriteOptionsHasExpectedDefaults () {
250- logging .setFlushSeverity (Severity .ERROR );
251255 Capture <WriteOption > partialSuccessArg = Capture .newInstance ();
252256 logging .write (
253257 EasyMock .<Iterable <LogEntry >>anyObject (),
@@ -266,7 +270,6 @@ public void testDefaultWriteOptionsHasExpectedDefaults() {
266270
267271 @ Test
268272 public void testMdcValuesAreConvertedToLabels () {
269- logging .setFlushSeverity (Severity .ERROR );
270273 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
271274 logging .write (
272275 capture (capturedArgument ),
@@ -325,7 +328,6 @@ public void testMdcValuesAreConvertedToLabelsWithPassingNullValues() {
325328 MDC .put ("mdc1" , "value1" );
326329 MDC .put ("mdc2" , null );
327330 MDC .put ("mdc3" , "value3" );
328- logging .setFlushSeverity (Severity .ERROR );
329331 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
330332 logging .write (
331333 capture (capturedArgument ),
@@ -351,7 +353,6 @@ public void testMdcValuesAreConvertedToLabelsWithPassingNullValues() {
351353 @ Test
352354 public void testAddCustomLoggingEventEnhancers () {
353355 MDC .put ("mdc1" , "value1" );
354- logging .setFlushSeverity (Severity .ERROR );
355356 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
356357 logging .write (
357358 capture (capturedArgument ),
@@ -375,7 +376,6 @@ public void testAddCustomLoggingEventEnhancers() {
375376
376377 @ Test
377378 public void testAddCustomLoggingEnhancer () {
378- logging .setFlushSeverity (Severity .ERROR );
379379 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
380380 logging .write (
381381 capture (capturedArgument ),
@@ -398,7 +398,6 @@ public void testAddCustomLoggingEnhancer() {
398398 @ Test
399399 @ SuppressWarnings ("deprecation" )
400400 public void testFlush () {
401- logging .setFlushSeverity (Severity .ERROR );
402401 logging .write (
403402 EasyMock .<Iterable <LogEntry >>anyObject (),
404403 anyObject (WriteOption .class ),
@@ -419,7 +418,6 @@ public void testFlush() {
419418
420419 @ Test
421420 public void testAutoPopulationEnabled () {
422- logging .setFlushSeverity (Severity .ERROR );
423421 Capture <Iterable <LogEntry >> capturedLogEntries = Capture .newInstance ();
424422 EasyMock .expect (
425423 logging .populateMetadata (
@@ -458,7 +456,6 @@ public void testAutoPopulationEnabled() {
458456
459457 @ Test
460458 public void testRedirectToStdoutEnabled () {
461- logging .setFlushSeverity (Severity .ERROR );
462459 EasyMock .expect (
463460 logging .populateMetadata (
464461 EasyMock .<Iterable <LogEntry >>anyObject (),
@@ -503,7 +500,6 @@ public void testRedirectToStdoutDisabled() {
503500 public void testFDiagnosticInfoAdded () {
504501 LoggingAppender .setInstrumentationStatus (false );
505502 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
506- logging .setFlushSeverity (Severity .ERROR );
507503 logging .write (
508504 capture (capturedArgument ),
509505 anyObject (WriteOption .class ),
@@ -547,7 +543,6 @@ public void testFDiagnosticInfoAdded() {
547543
548544 @ Test
549545 public void testFDiagnosticInfoNotAdded () {
550- logging .setFlushSeverity (Severity .ERROR );
551546 Capture <Iterable <LogEntry >> capturedArgument = Capture .newInstance ();
552547 logging .write (
553548 capture (capturedArgument ),
0 commit comments