public String[] getTablenames() throws KettleDatabaseException {
    return getTablenames( false );
  }
@Test
  public void testGetTablenames() throws SQLException, KettleDatabaseException {
    when( rs.next() ).thenReturn( true, false );
    when( rs.getString( "TABLE_NAME" ) ).thenReturn( EXISTING_TABLE_NAME );
    when( dbMetaMock.getTables(
      same( dbMetaDataMock ), or( anyString(), eq( null ) ), or( anyString(), eq( null ) ), any() ) ).thenReturn( rs );
    Database db = new Database( log, dbMetaMock );
    db.setConnection( mockConnection( dbMetaDataMock ) );

    String[] tableNames = db.getTablenames();
    assertEquals( tableNames.length, 1 );
  }