Replace deprecated API in ElasticsearchReactiveHealthIndicator

Fixes gh-23537
This commit is contained in:
Scott Frederick
2020-10-08 14:26:30 -05:00
parent 3f7b4ed890
commit b59e0bd3a6
2 changed files with 5 additions and 8 deletions

View File

@@ -32,7 +32,6 @@ import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsea
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
@@ -41,20 +40,18 @@ import static org.assertj.core.api.Assertions.entry;
* Tests for {@link ElasticsearchReactiveHealthIndicator}
*
* @author Brian Clozel
* @author Scott Frederick
*/
class ElasticsearchReactiveHealthIndicatorTests {
private MockWebServer server;
private WebClient.Builder builder;
private ElasticsearchReactiveHealthIndicator healthIndicator;
@BeforeEach
void setup() throws Exception {
this.server = new MockWebServer();
this.server.start();
this.builder = WebClient.builder().baseUrl(this.server.url("/").toString());
ReactiveElasticsearchClient client = DefaultReactiveElasticsearchClient
.create(ClientConfiguration.create(this.server.getHostName() + ":" + this.server.getPort()));
this.healthIndicator = new ElasticsearchReactiveHealthIndicator(client);