public static void getFields( DatabaseMeta databaseMeta, String tablename,
                                Consumer<RowMetaInterface> fieldsConsumer ) {
    executeAction( databaseMeta, database -> {
      try {
        fieldsConsumer.accept( database.getTableFields( tablename ) );
      } catch ( KettleDatabaseException | NullPointerException e ) {
        logError( databaseMeta, e );
        fieldsConsumer.accept( new RowMeta() );
      }
    } );
  }
@Test
  public void getFields() throws InterruptedException, ExecutionException, TimeoutException {
    CompletableFuture<RowMetaInterface> rowMetaCompletion = new CompletableFuture<>();
    AsyncDatabaseAction.getFields( dbMeta, "BAZ", rowMetaCompletion::complete );
    RowMetaInterface rowMeta = rowMetaCompletion.get( COMPLETION_TIMEOUT, TimeUnit.MILLISECONDS );
    assertThat( rowMeta.size(), equalTo( 3 ) );
    assertThat( sorted( rowMeta.getFieldNames() ), equalTo( new String[] { "COL1", "COL2", "COL3" } ) );
  }