66package org .elasticsearch .xpack .ccr .action ;
77
88import org .elasticsearch .common .io .stream .Writeable ;
9- import org .elasticsearch .common .unit .ByteSizeValue ;
10- import org .elasticsearch .common .unit .TimeValue ;
119import org .elasticsearch .common .xcontent .ConstructingObjectParser ;
12- import org .elasticsearch .common .xcontent .ObjectParser ;
1310import org .elasticsearch .common .xcontent .XContentParser ;
1411import org .elasticsearch .test .AbstractSerializingTestCase ;
1512import org .elasticsearch .xpack .core .ccr .action .FollowInfoAction ;
2623
2724public class FollowInfoResponseTests extends AbstractSerializingTestCase <FollowInfoAction .Response > {
2825
29- static final ObjectParser <FollowParameters , Void > PARAMETERS_PARSER = new ObjectParser <>("parameters_parser" , FollowParameters ::new );
3026 static final ConstructingObjectParser <FollowerInfo , Void > INFO_PARSER = new ConstructingObjectParser <>(
3127 "info_parser" ,
3228 args -> {
@@ -40,13 +36,12 @@ public class FollowInfoResponseTests extends AbstractSerializingTestCase<FollowI
4036 });
4137
4238 static {
43- FollowParameters .initParser (PARAMETERS_PARSER );
44-
4539 INFO_PARSER .declareString (ConstructingObjectParser .constructorArg (), FollowerInfo .FOLLOWER_INDEX_FIELD );
4640 INFO_PARSER .declareString (ConstructingObjectParser .constructorArg (), FollowerInfo .REMOTE_CLUSTER_FIELD );
4741 INFO_PARSER .declareString (ConstructingObjectParser .constructorArg (), FollowerInfo .LEADER_INDEX_FIELD );
4842 INFO_PARSER .declareString (ConstructingObjectParser .constructorArg (), FollowerInfo .STATUS_FIELD );
49- INFO_PARSER .declareObject (ConstructingObjectParser .optionalConstructorArg (), PARAMETERS_PARSER , FollowerInfo .PARAMETERS_FIELD );
43+ INFO_PARSER .declareObject (ConstructingObjectParser .optionalConstructorArg (), FollowParametersTests .PARSER ,
44+ FollowerInfo .PARAMETERS_FIELD );
5045 }
5146
5247 @ SuppressWarnings ("unchecked" )
@@ -79,17 +74,7 @@ protected FollowInfoAction.Response createTestInstance() {
7974 for (int i = 0 ; i < numInfos ; i ++) {
8075 FollowParameters followParameters = null ;
8176 if (randomBoolean ()) {
82- followParameters = new FollowParameters ();
83- followParameters .setMaxOutstandingReadRequests (randomIntBetween (0 , Integer .MAX_VALUE ));
84- followParameters .setMaxOutstandingWriteRequests (randomIntBetween (0 , Integer .MAX_VALUE ));
85- followParameters .setMaxReadRequestOperationCount (randomIntBetween (0 , Integer .MAX_VALUE ));
86- followParameters .setMaxWriteRequestOperationCount (randomIntBetween (0 , Integer .MAX_VALUE ));
87- followParameters .setMaxReadRequestSize (new ByteSizeValue (randomNonNegativeLong ()));
88- followParameters .setMaxWriteRequestSize (new ByteSizeValue (randomNonNegativeLong ()));
89- followParameters .setMaxWriteBufferCount (randomIntBetween (0 , Integer .MAX_VALUE ));
90- followParameters .setMaxWriteBufferSize (new ByteSizeValue (randomNonNegativeLong ()));
91- followParameters .setMaxRetryDelay (new TimeValue (randomNonNegativeLong ()));
92- followParameters .setReadPollTimeout (new TimeValue (randomNonNegativeLong ()));
77+ followParameters = FollowParametersTests .randomInstance ();
9378 }
9479
9580 infos .add (new FollowerInfo (randomAlphaOfLength (4 ), randomAlphaOfLength (4 ), randomAlphaOfLength (4 ),
0 commit comments