|  | 
| 16 | 16 | 
 | 
| 17 | 17 | package org.springframework.boot.actuate.elasticsearch; | 
| 18 | 18 | 
 | 
|  | 19 | +import java.io.IOException; | 
|  | 20 | + | 
| 19 | 21 | import com.google.gson.Gson; | 
| 20 | 22 | import com.google.gson.JsonParser; | 
| 21 | 23 | import io.searchbox.action.Action; | 
|  | 
| 24 | 26 | import io.searchbox.client.config.exception.CouldNotConnectException; | 
| 25 | 27 | import io.searchbox.core.SearchResult; | 
| 26 | 28 | import org.junit.Test; | 
|  | 29 | + | 
| 27 | 30 | import org.springframework.boot.actuate.health.Health; | 
| 28 | 31 | import org.springframework.boot.actuate.health.Status; | 
| 29 | 32 | 
 | 
| 30 |  | -import java.io.IOException; | 
| 31 |  | - | 
| 32 | 33 | import static org.assertj.core.api.Assertions.assertThat; | 
| 33 | 34 | import static org.mockito.ArgumentMatchers.any; | 
| 34 | 35 | import static org.mockito.BDDMockito.given; | 
| @@ -91,14 +92,16 @@ public void elasticsearchIsOutOfServiceBySucceeded() throws IOException { | 
| 91 | 92 | 		assertThat(health.getStatus()).isEqualTo(Status.OUT_OF_SERVICE); | 
| 92 | 93 | 	} | 
| 93 | 94 | 
 | 
| 94 |  | -	private static JestResult createJestResult(String status, int responseCode, boolean succeeded) { | 
| 95 |  | -		String json = String.format("{\"cluster_name\":\"docker-cluster\"," + | 
| 96 |  | -				"\"status\":\"%s\",\"timed_out\":false,\"number_of_nodes\":1," + | 
| 97 |  | -				"\"number_of_data_nodes\":1,\"active_primary_shards\":0," + | 
| 98 |  | -				"\"active_shards\":0,\"relocating_shards\":0,\"initializing_shards\":0," + | 
| 99 |  | -				"\"unassigned_shards\":0,\"delayed_unassigned_shards\":0," + | 
| 100 |  | -				"\"number_of_pending_tasks\":0,\"number_of_in_flight_fetch\":0," + | 
| 101 |  | -				"\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":100.0}", status); | 
|  | 95 | +	private static JestResult createJestResult(String status, int responseCode, | 
|  | 96 | +			boolean succeeded) { | 
|  | 97 | +		String json = String.format("{\"cluster_name\":\"docker-cluster\"," | 
|  | 98 | +				+ "\"status\":\"%s\",\"timed_out\":false,\"number_of_nodes\":1," | 
|  | 99 | +				+ "\"number_of_data_nodes\":1,\"active_primary_shards\":0," | 
|  | 100 | +				+ "\"active_shards\":0,\"relocating_shards\":0,\"initializing_shards\":0," | 
|  | 101 | +				+ "\"unassigned_shards\":0,\"delayed_unassigned_shards\":0," | 
|  | 102 | +				+ "\"number_of_pending_tasks\":0,\"number_of_in_flight_fetch\":0," | 
|  | 103 | +				+ "\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":100.0}", | 
|  | 104 | +				status); | 
| 102 | 105 | 		SearchResult searchResult = new SearchResult(new Gson()); | 
| 103 | 106 | 		searchResult.setJsonString(json); | 
| 104 | 107 | 		searchResult.setJsonObject(new JsonParser().parse(json).getAsJsonObject()); | 
|  | 
0 commit comments