### Question:
PreFlightTasks { public boolean run() { if ( tasks == null || tasks.length < 1 ) { return true; } for ( PreflightTask r : tasks ) { if ( !r.run() ) { log.error( r.getFailureMessage() ); failedTask = r; return false; } } return true; } PreFlightTasks( LogProvider logProvider, PreflightTask... tasks ); boolean run(); PreflightTask failedTask();  }### Answer:
@Test public void shouldPassWithNoRules() { PreFlightTasks check = new PreFlightTasks( NullLogProvider.getInstance() ); assertTrue( check.run() ); }
@Test public void shouldRunAllHealthChecksToCompletionIfNonFail() { PreFlightTasks check = new PreFlightTasks( NullLogProvider.getInstance(), getPassingRules() ); assertTrue( check.run() ); }
@Test public void shouldFailIfOneOrMoreHealthChecksFail() { PreFlightTasks check = new PreFlightTasks( NullLogProvider.getInstance(), getWithOneFailingRule() ); assertFalse( check.run() ); }
@Test public void shouldLogFailedRule() { AssertableLogProvider logProvider = new AssertableLogProvider(); PreFlightTasks check = new PreFlightTasks( logProvider, getWithOneFailingRule() ); check.run(); logProvider.assertExactly( inLog( PreFlightTasks.class ).error( "blah blah" ) ); }