@@ -65,7 +65,8 @@ public void testNegativeSetting() throws InterruptedException {
6565 Settings settings = Settings .builder ().put ("monitor.jvm.gc.collector." + collector + ".warn" , "-" + randomTimeValue ()).build ();
6666 execute (settings , (command , interval , name ) -> null , e -> {
6767 assertThat (e , instanceOf (IllegalArgumentException .class ));
68- assertThat (e .getMessage (), allOf (containsString ("invalid gc_threshold" ), containsString ("for [monitor.jvm.gc.collector." + collector + "." )));
68+ assertThat (e .getMessage (), allOf (containsString ("invalid gc_threshold" ),
69+ containsString ("for [monitor.jvm.gc.collector." + collector + "." )));
6970 }, true , null );
7071 }
7172
@@ -78,8 +79,9 @@ public void testMissingSetting() throws InterruptedException {
7879 Settings .Builder builder = Settings .builder ();
7980
8081 // drop a random setting or two
81- for (@ SuppressWarnings ("unchecked" ) AbstractMap .SimpleEntry <String , String > entry : randomSubsetOf (randomIntBetween (1 , 2 ), entries .toArray (new AbstractMap .SimpleEntry [0 ]))) {
82- builder .put (entry .getKey (), entry .getValue ());
82+ for (@ SuppressWarnings ("unchecked" ) AbstractMap .SimpleEntry <String , String > entry : randomSubsetOf (randomIntBetween (1 , 2 ),
83+ entries .toArray (new AbstractMap .SimpleEntry [0 ]))) {
84+ builder .put (entry .getKey (), entry .getValue ());
8385 }
8486
8587 // we should get an exception that a setting is missing
@@ -115,25 +117,31 @@ public void testIllegalOverheadSettings() throws InterruptedException {
115117 infoWarnOutOfOrderBuilder .put ("monitor.jvm.gc.overhead.warn" , warn );
116118 execute (infoWarnOutOfOrderBuilder .build (), (command , interval , name ) -> null , e -> {
117119 assertThat (e , instanceOf (IllegalArgumentException .class ));
118- assertThat (e .getMessage (), containsString ("[monitor.jvm.gc.overhead.warn] must be greater than [monitor.jvm.gc.overhead.info] [" + info + "] but was [" + warn + "]" ));
120+ assertThat (e .getMessage (), containsString ("[monitor.jvm.gc.overhead.warn] must be greater than "
121+ + "[monitor.jvm.gc.overhead.info] [" + info + "] but was [" + warn + "]" ));
119122 }, true , null );
120123
121124 final Settings .Builder debugInfoOutOfOrderBuilder = Settings .builder ();
122125 debugInfoOutOfOrderBuilder .put ("monitor.jvm.gc.overhead.info" , info );
123126 final int debug = randomIntBetween (info + 1 , 99 );
124127 debugInfoOutOfOrderBuilder .put ("monitor.jvm.gc.overhead.debug" , debug );
125- debugInfoOutOfOrderBuilder .put ("monitor.jvm.gc.overhead.warn" , randomIntBetween (debug + 1 , 100 )); // or the test will fail for the wrong reason
128+ debugInfoOutOfOrderBuilder .put ("monitor.jvm.gc.overhead.warn" ,
129+ randomIntBetween (debug + 1 , 100 )); // or the test will fail for the wrong reason
126130 execute (debugInfoOutOfOrderBuilder .build (), (command , interval , name ) -> null , e -> {
127131 assertThat (e , instanceOf (IllegalArgumentException .class ));
128- assertThat (e .getMessage (), containsString ("[monitor.jvm.gc.overhead.info] must be greater than [monitor.jvm.gc.overhead.debug] [" + debug + "] but was [" + info + "]" ));
132+ assertThat (e .getMessage (), containsString ("[monitor.jvm.gc.overhead.info] must be greater than "
133+ + "[monitor.jvm.gc.overhead.debug] [" + debug + "] but was [" + info + "]" ));
129134 }, true , null );
130135 }
131136
132- private static void execute (Settings settings , TriFunction <Runnable , TimeValue , String , Cancellable > scheduler , Runnable asserts ) throws InterruptedException {
137+ private static void execute (Settings settings , TriFunction <Runnable , TimeValue , String , Cancellable > scheduler ,
138+ Runnable asserts ) throws InterruptedException {
133139 execute (settings , scheduler , null , false , asserts );
134140 }
135141
136- private static void execute (Settings settings , TriFunction <Runnable , TimeValue , String , Cancellable > scheduler , Consumer <Throwable > consumer , boolean constructionShouldFail , Runnable asserts ) throws InterruptedException {
142+ private static void execute (Settings settings , TriFunction <Runnable , TimeValue , String , Cancellable > scheduler ,
143+ Consumer <Throwable > consumer , boolean constructionShouldFail ,
144+ Runnable asserts ) throws InterruptedException {
137145 assert constructionShouldFail == (consumer != null );
138146 assert constructionShouldFail == (asserts == null );
139147 ThreadPool threadPool = null ;
0 commit comments