Consistent error messages in metadata java tests