@@ -67,7 +67,8 @@ public void testIndexLifecycleActionsWith11Shards1Backup() throws Exception {
6767 final String node1 = getLocalNodeId (server_1 );
6868
6969 logger .info ("Creating index [test]" );
70- CreateIndexResponse createIndexResponse = client ().admin ().indices ().create (createIndexRequest ("test" ).settings (settings )).actionGet ();
70+ CreateIndexResponse createIndexResponse = client ().admin ().indices ().create (
71+ createIndexRequest ("test" ).settings (settings )).actionGet ();
7172 assertAcked (createIndexResponse );
7273
7374 ClusterState clusterState = client ().admin ().cluster ().prepareState ().get ().getState ();
@@ -90,7 +91,8 @@ public void testIndexLifecycleActionsWith11Shards1Backup() throws Exception {
9091 // explicitly call reroute, so shards will get relocated to the new node (we delay it in ES in case other nodes join)
9192 client ().admin ().cluster ().prepareReroute ().execute ().actionGet ();
9293
93- clusterHealth = client ().admin ().cluster ().health (clusterHealthRequest ().waitForGreenStatus ().waitForNodes ("2" ).waitForNoRelocatingShards (true )).actionGet ();
94+ clusterHealth = client ().admin ().cluster ().health (
95+ clusterHealthRequest ().waitForGreenStatus ().waitForNodes ("2" ).waitForNoRelocatingShards (true )).actionGet ();
9496 assertThat (clusterHealth .isTimedOut (), equalTo (false ));
9597 assertThat (clusterHealth .getStatus (), equalTo (ClusterHealthStatus .GREEN ));
9698 assertThat (clusterHealth .getNumberOfDataNodes (), equalTo (2 ));
@@ -127,7 +129,8 @@ public void testIndexLifecycleActionsWith11Shards1Backup() throws Exception {
127129 // explicitly call reroute, so shards will get relocated to the new node (we delay it in ES in case other nodes join)
128130 client ().admin ().cluster ().prepareReroute ().execute ().actionGet ();
129131
130- clusterHealth = client ().admin ().cluster ().health (clusterHealthRequest ().waitForGreenStatus ().waitForNodes ("3" ).waitForNoRelocatingShards (true )).actionGet ();
132+ clusterHealth = client ().admin ().cluster ().health (
133+ clusterHealthRequest ().waitForGreenStatus ().waitForNodes ("3" ).waitForNoRelocatingShards (true )).actionGet ();
131134 assertThat (clusterHealth .isTimedOut (), equalTo (false ));
132135 assertThat (clusterHealth .getStatus (), equalTo (ClusterHealthStatus .GREEN ));
133136 assertThat (clusterHealth .getNumberOfDataNodes (), equalTo (3 ));
@@ -145,7 +148,9 @@ public void testIndexLifecycleActionsWith11Shards1Backup() throws Exception {
145148 routingNodeEntry2 = clusterState .getRoutingNodes ().node (node2 );
146149 RoutingNode routingNodeEntry3 = clusterState .getRoutingNodes ().node (node3 );
147150
148- assertThat (routingNodeEntry1 .numberOfShardsWithState (STARTED ) + routingNodeEntry2 .numberOfShardsWithState (STARTED ) + routingNodeEntry3 .numberOfShardsWithState (STARTED ), equalTo (22 ));
151+ assertThat (routingNodeEntry1 .numberOfShardsWithState (STARTED ) +
152+ routingNodeEntry2 .numberOfShardsWithState (STARTED ) +
153+ routingNodeEntry3 .numberOfShardsWithState (STARTED ), equalTo (22 ));
149154
150155 assertThat (routingNodeEntry1 .numberOfShardsWithState (RELOCATING ), equalTo (0 ));
151156 assertThat (routingNodeEntry1 .numberOfShardsWithState (STARTED ), anyOf (equalTo (7 ), equalTo (8 )));
@@ -168,7 +173,8 @@ public void testIndexLifecycleActionsWith11Shards1Backup() throws Exception {
168173
169174 client ().admin ().cluster ().prepareReroute ().get ();
170175
171- clusterHealth = client ().admin ().cluster ().health (clusterHealthRequest ().waitForGreenStatus ().waitForNoRelocatingShards (true ).waitForNodes ("2" )).actionGet ();
176+ clusterHealth = client ().admin ().cluster ().health (
177+ clusterHealthRequest ().waitForGreenStatus ().waitForNoRelocatingShards (true ).waitForNodes ("2" )).actionGet ();
172178 assertThat (clusterHealth .isTimedOut (), equalTo (false ));
173179 assertThat (clusterHealth .getStatus (), equalTo (ClusterHealthStatus .GREEN ));
174180 assertThat (clusterHealth .getRelocatingShards (), equalTo (0 ));
@@ -211,7 +217,9 @@ private String getLocalNodeId(String name) {
211217 }
212218
213219 private void assertNodesPresent (RoutingNodes routingNodes , String ... nodes ) {
214- final Set <String > keySet = StreamSupport .stream (routingNodes .spliterator (), false ).map ((p ) -> (p .nodeId ())).collect (Collectors .toSet ());
220+ final Set <String > keySet = StreamSupport .stream (routingNodes .spliterator (), false )
221+ .map (RoutingNode ::nodeId )
222+ .collect (Collectors .toSet ());
215223 assertThat (keySet , containsInAnyOrder (nodes ));
216224 }
217225}
0 commit comments