There are two arguments for using accessor methods instead of public variables:
Access Control: A method allows us to publish only a getter method, or to add value-based (in contrast to type-based) constraints on a setter. With
public final identifiers, this point is irrelevant, as that value can't be changed, and invariants therefore can't be broken by client code.
Uniform Access: The method of accessing data in an object should not leak information on whether this data is stored or computed on the fly. In languages without “properties” – such as Java – this means that any data should be accessed via methods, and that no variable should ever be
public. But why does the Uniform Access Principle exist in the first place? It's meant to reserve leeway for reimplementing the internals of an object without changing the public interface, so that client code using that object will not break.
But in your situation there is no client code that uses a public API, you are just storing data for tests. Because there is no API to maintain, the justification for the UAP falls away (although following it does still get you all the advantages).
So there are no compelling arguments for using either solution. It's a pretty level field, and you can choose freely.
Note that using methods is absolutely required when each access needs to return a new instance. This is irrelevant for immutable objects such as strings. Otherwise, you should consider accessing all test data through methods for consistency's sake.
My personal opinion would be to choose the simplest thing possible, which would be using
public final variables. However, please use member variables and not
static ones, so that your tests can pass test data around as a first class object. (I know you can access static data via instances, but I consider that to be an anti-pattern).
If there are people on your team who are not familiar with Java, it might be better to store the test data in a configuration file (I recommend the YAML format). Instead of writing your own class, you would then be using the configuration file parser to access the data.