File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
server/src/test/java/org/elasticsearch/cluster Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,16 @@ public String getWriteableName() {
155155 return TYPE ;
156156 }
157157
158+ /*
159+ * This custom should always be returned yet we randomize whether it has a required feature that the client is expected to have
160+ * versus not requiring any feature. We use a field to make the random choice exactly once.
161+ */
162+ @ SuppressWarnings ("OptionalUsedAsFieldOrParameterType" )
163+ private final Optional <String > requiredFeature = randomBoolean () ? Optional .empty () : Optional .of ("node-and-transport-client" );
164+
158165 @ Override
159166 public Optional <String > getRequiredFeature () {
160- return Optional . of ( "node-and-transport-client" ) ;
167+ return requiredFeature ;
161168 }
162169
163170 }
You can’t perform that action at this time.
0 commit comments