[TEST] Fix GetUserPrivilegesResponse#Indices(StreamInput) constr

Closes #34631
This commit is contained in:
Albert Zaharovits 2018-10-19 14:29:37 +03:00
parent 7b49beb9b0
commit aeb3cda585
1 changed files with 3 additions and 2 deletions

View File

@ -132,8 +132,9 @@ public final class GetUserPrivilegesResponse extends ActionResponse {
}
public Indices(StreamInput in) throws IOException {
indices = Collections.unmodifiableSet(in.readSet(StreamInput::readString));
privileges = Collections.unmodifiableSet(in.readSet(StreamInput::readString));
// The use of TreeSet is to provide a consistent order that can be relied upon in tests
indices = Collections.unmodifiableSet(new TreeSet<>(in.readSet(StreamInput::readString)));
privileges = Collections.unmodifiableSet(new TreeSet<>(in.readSet(StreamInput::readString)));
fieldSecurity = Collections.unmodifiableSet(in.readSet(input -> {
final String[] grant = input.readOptionalStringArray();
final String[] exclude = input.readOptionalStringArray();