public static void executeSql( DatabaseMeta databaseMeta, String sql, Consumer<List<Object[]>> rowConsumer ) {
    executeAction( databaseMeta, database -> {
      try {
        rowConsumer.accept( database.getRows( sql, ROW_LIMIT ) );
      } catch ( KettleDatabaseException | NullPointerException e ) {
        logError( databaseMeta, e );
        rowConsumer.accept( Collections.emptyList() );
      }
    } );
  }
@SuppressWarnings( "squid:S2699" )  // assertion is implicit. non-timeout validates that an error event was logged
  @Test public void testDbErrorsSqlAction() throws InterruptedException, ExecutionException, TimeoutException {
    dbMeta.setDatabaseType( "GENERIC" ); // causes incorrect jdbc url to be used.
    CompletableFuture<List<Object[]>> rowMetaCompletion = new CompletableFuture<>();
    AsyncDatabaseAction.executeSql( dbMeta, "SELECT * FROM BAR", rowMetaCompletion::complete );
    // blocks till an error message is logged, or timeoutexception
    errorLogListener.errorOccurred.get( COMPLETION_TIMEOUT, TimeUnit.MILLISECONDS );
  }