Skip to content

Commit aeb3cda

Browse files
[TEST] Fix GetUserPrivilegesResponse#Indices(StreamInput) constr
Closes #34631
1 parent 7b49beb commit aeb3cda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ public Indices(Collection<String> indices, Collection<String> privileges,
132132
}
133133

134134
public Indices(StreamInput in) throws IOException {
135-
indices = Collections.unmodifiableSet(in.readSet(StreamInput::readString));
136-
privileges = Collections.unmodifiableSet(in.readSet(StreamInput::readString));
135+
// The use of TreeSet is to provide a consistent order that can be relied upon in tests
136+
indices = Collections.unmodifiableSet(new TreeSet<>(in.readSet(StreamInput::readString)));
137+
privileges = Collections.unmodifiableSet(new TreeSet<>(in.readSet(StreamInput::readString)));
137138
fieldSecurity = Collections.unmodifiableSet(in.readSet(input -> {
138139
final String[] grant = input.readOptionalStringArray();
139140
final String[] exclude = input.readOptionalStringArray();

0 commit comments

Comments
 (0)