Package org.elasticsearch.test.rest
Class ESRestTestCase.VersionSensitiveWarningsHandler
java.lang.Object
org.elasticsearch.test.rest.ESRestTestCase.VersionSensitiveWarningsHandler
- All Implemented Interfaces:
org.elasticsearch.client.WarningsHandler
- Enclosing class:
- ESRestTestCase
public static class ESRestTestCase.VersionSensitiveWarningsHandler
extends java.lang.Object
implements org.elasticsearch.client.WarningsHandler
Helper class to check warnings in REST responses with sensitivity to versions
used in the target cluster.
-
Field Summary
Fields inherited from interface org.elasticsearch.client.WarningsHandler
PERMISSIVE, STRICT
-
Constructor Summary
Constructors Constructor Description VersionSensitiveWarningsHandler(java.util.Set<org.elasticsearch.Version> nodeVersions)
-
Method Summary
Modifier and Type Method Description void
compatible(java.lang.String... allowedWarnings)
Adds to the set of warnings that are permissible (but not required) when running in mixed-version clusters or those that differ in version from the test client.void
current(java.lang.String... requiredWarnings)
Adds to the set of warnings that are all required in responses if the cluster is formed from nodes all running the exact same version as the client.boolean
warningsShouldFailRequest(java.util.List<java.lang.String> warnings)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
VersionSensitiveWarningsHandler
public VersionSensitiveWarningsHandler(java.util.Set<org.elasticsearch.Version> nodeVersions)
-
-
Method Details
-
current
public void current(java.lang.String... requiredWarnings)Adds to the set of warnings that are all required in responses if the cluster is formed from nodes all running the exact same version as the client.- Parameters:
requiredWarnings
- a set of required warnings
-
compatible
public void compatible(java.lang.String... allowedWarnings)Adds to the set of warnings that are permissible (but not required) when running in mixed-version clusters or those that differ in version from the test client.- Parameters:
allowedWarnings
- optional warnings that will be ignored if received
-
warningsShouldFailRequest
public boolean warningsShouldFailRequest(java.util.List<java.lang.String> warnings)- Specified by:
warningsShouldFailRequest
in interfaceorg.elasticsearch.client.WarningsHandler
-