|
@@ -736,7 +736,6 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
assertSubmitTaskMethod(methods, method, apiName, restSpec);
|
|
|
} else {
|
|
|
assertSyncMethod(method, apiName);
|
|
|
-
|
|
|
boolean remove = apiSpec.remove(apiName);
|
|
|
if (remove == false) {
|
|
|
if (deprecatedMethods.contains(apiName)) {
|
|
@@ -771,7 +770,7 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
assertThat("Some API are not supported but they should be: " + apiSpec, apiSpec.size(), equalTo(0));
|
|
|
}
|
|
|
|
|
|
- private void assertSyncMethod(Method method, String apiName) {
|
|
|
+ private static void assertSyncMethod(Method method, String apiName) {
|
|
|
//A few methods return a boolean rather than a response object
|
|
|
if (apiName.equals("ping") || apiName.contains("exist")) {
|
|
|
assertThat("the return type for method [" + method + "] is incorrect",
|
|
@@ -787,7 +786,8 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
assertEquals("incorrect number of exceptions for method [" + method + "]", 1, method.getExceptionTypes().length);
|
|
|
//a few methods don't accept a request object as argument
|
|
|
if (apiName.equals("ping") || apiName.equals("info") || apiName.equals("security.get_ssl_certificates")
|
|
|
- || apiName.equals("security.authenticate")) {
|
|
|
+ || apiName.equals("security.authenticate") || apiName.equals("license.get_trial_status")
|
|
|
+ || apiName.equals("license.get_basic_status")) {
|
|
|
assertEquals("incorrect number of arguments for method [" + method + "]", 1, method.getParameterTypes().length);
|
|
|
assertThat("the parameter to method [" + method + "] is the wrong type",
|
|
|
method.getParameterTypes()[0], equalTo(RequestOptions.class));
|
|
@@ -800,7 +800,7 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void assertAsyncMethod(Map<String, Method> methods, Method method, String apiName) {
|
|
|
+ private static void assertAsyncMethod(Map<String, Method> methods, Method method, String apiName) {
|
|
|
assertTrue("async method [" + method.getName() + "] doesn't have corresponding sync method",
|
|
|
methods.containsKey(apiName.substring(0, apiName.length() - 6)));
|
|
|
assertThat("async method [" + method + "] should return void", method.getReturnType(), equalTo(Void.TYPE));
|
|
@@ -820,7 +820,8 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void assertSubmitTaskMethod(Map<String, Method> methods, Method method, String apiName, ClientYamlSuiteRestSpec restSpec) {
|
|
|
+ private static void assertSubmitTaskMethod(Map<String, Method> methods, Method method, String apiName,
|
|
|
+ ClientYamlSuiteRestSpec restSpec) {
|
|
|
String methodName = extractMethodName(apiName);
|
|
|
assertTrue("submit task method [" + method.getName() + "] doesn't have corresponding sync method",
|
|
|
methods.containsKey(methodName));
|
|
@@ -834,11 +835,11 @@ public class RestHighLevelClientTests extends ESTestCase {
|
|
|
restSpec.getApi(methodName).getParams(), Matchers.hasKey("wait_for_completion"));
|
|
|
}
|
|
|
|
|
|
- private String extractMethodName(String apiName) {
|
|
|
+ private static String extractMethodName(String apiName) {
|
|
|
return apiName.substring(SUBMIT_TASK_PREFIX.length(), apiName.length() - SUBMIT_TASK_SUFFIX.length());
|
|
|
}
|
|
|
|
|
|
- private boolean isSubmitTaskMethod(String apiName) {
|
|
|
+ private static boolean isSubmitTaskMethod(String apiName) {
|
|
|
return apiName.startsWith(SUBMIT_TASK_PREFIX) && apiName.endsWith(SUBMIT_TASK_SUFFIX);
|
|
|
}
|
|
|
|