@Test
public void getUpdateOptionsTest() {

  when( teraDataBulkLoaderMetaMock.getDatabaseMeta() ).thenReturn( dataBaseMetaDataMock );
  when( dataBaseMetaDataMock.getHostname() ).thenReturn( "hostname" );
  when( dataBaseMetaDataMock.getUsername() ).thenReturn( "username" );
  when( dataBaseMetaDataMock.getPassword() ).thenReturn( "passwordFromMeta" );
  when( teraDataBulkLoaderMetaMock.getUpdateLogFile() ).thenReturn( "logFile" );
  when( teraDataBulkLoaderMetaMock.getLogTable() ).thenReturn( "logTable" );
  when( teraDataBulkLoaderMetaMock.getTableName() ).thenReturn( "tableName" );
  when( teraDataBulkLoaderMetaMock.getWorkTable() ).thenReturn( "workTable" );
  when( teraDataBulkLoaderMetaMock.getErrorTable() ).thenReturn( "errorTable" );
  when( teraDataBulkLoaderMetaMock.getErrorTable2() ).thenReturn( "errorTable2" );
  when( teraDataBulkLoaderMetaMock.getDbName() ).thenReturn( "dbName" );
  setInternalState( teraDataBulkLoaderRoutines, "parent", teraDataBulkLoaderMock );
  Variables variables = new Variables();
  //Init the variables in the step
  setInternalState( teraDataBulkLoaderMock, "variables", variables );
  when( teraDataBulkLoaderMock.environmentSubstitute( anyString() ) ).thenCallRealMethod();
  String password = "myPassword";
  String expectedUpdataOptionsPreview = "DEFINE OPERATOR UPDATE_OPERATOR\n"
    + "TYPE UPDATE\n"
    + "SCHEMA *\n"
    + "ATTRIBUTES\n"
    + "  (\n"
    + "     VARCHAR TdpId              = 'hostname',\n"
    + "     VARCHAR PrivateLogName     = 'logFile',\n"
    + "     VARCHAR UserName           = 'username',\n"
    + "     VARCHAR UserPassword       = 'passwordFromMeta',\n"
    + "     VARCHAR LogTable           = 'logTable',\n"
    + "     VARCHAR TargetTable        = 'dbName.tableName',\n"
    + "     VARCHAR WorkTable          = 'workTable',\n"
    + "     VARCHAR ErrorTable1        = 'errorTable',\n"
    + "     VARCHAR ErrorTable2        = 'errorTable2'\n"
    + "  );\n";
  assertEquals( expectedUpdataOptionsPreview, teraDataBulkLoaderRoutines.getUpdateOptions( false, password ).toString() );
}