|
@@ -41,6 +41,15 @@ public class MlBasicMultiNodeIT extends ESRestTestCase {
|
|
|
)
|
|
|
.build();
|
|
|
|
|
|
+ private static final RequestOptions FLUSH_OPTIONS = RequestOptions.DEFAULT.toBuilder()
|
|
|
+ .setWarningsHandler(
|
|
|
+ warnings -> Collections.singletonList(
|
|
|
+ "Forcing any buffered data to be processed is deprecated, "
|
|
|
+ + "in a future major version it will be compulsory to use a datafeed"
|
|
|
+ ).equals(warnings) == false
|
|
|
+ )
|
|
|
+ .build();
|
|
|
+
|
|
|
public void testMachineLearningInstalled() throws Exception {
|
|
|
Response response = client().performRequest(new Request("GET", "/_xpack"));
|
|
|
Map<?, ?> features = (Map<?, ?>) entityAsMap(response).get("features");
|
|
@@ -93,7 +102,9 @@ public class MlBasicMultiNodeIT extends ESRestTestCase {
|
|
|
assertEquals(1403481600000L, responseBody.get("earliest_record_timestamp"));
|
|
|
assertEquals(1403481700000L, responseBody.get("latest_record_timestamp"));
|
|
|
|
|
|
- Response flushResponse = client().performRequest(new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_flush"));
|
|
|
+ Request flustRequest = new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_flush");
|
|
|
+ flustRequest.setOptions(FLUSH_OPTIONS);
|
|
|
+ Response flushResponse = client().performRequest(flustRequest);
|
|
|
assertFlushResponse(flushResponse, true, 1403481600000L);
|
|
|
|
|
|
Request closeRequest = new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_close");
|
|
@@ -191,7 +202,9 @@ public class MlBasicMultiNodeIT extends ESRestTestCase {
|
|
|
assertEquals(1403481600000L, responseBody.get("earliest_record_timestamp"));
|
|
|
assertEquals(1403482000000L, responseBody.get("latest_record_timestamp"));
|
|
|
|
|
|
- Response flushResponse = client().performRequest(new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_flush"));
|
|
|
+ Request flushRequest = new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_flush");
|
|
|
+ flushRequest.setOptions(FLUSH_OPTIONS);
|
|
|
+ Response flushResponse = client().performRequest(flushRequest);
|
|
|
assertFlushResponse(flushResponse, true, 1403481600000L);
|
|
|
|
|
|
Request closeRequest = new Request("POST", BASE_PATH + "anomaly_detectors/" + jobId + "/_close");
|