Replace deprecated API in ElasticsearchReactiveHealthIndicator
Fixes gh-23537
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user