From 2e02f58638b31c73acd8cd1b3dcbd41464454860 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 15 Mar 2023 16:39:40 +0000 Subject: [PATCH 1/2] Regenerate client from commit 315984bc of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 19 ++- .../client/v2/api/RestrictionPoliciesApi.java | 8 ++ .../java/com/datadog/api/ClientSteps.java | 117 ++++++++++++------ src/test/java/com/datadog/api/World.java | 48 ++++--- ...th_metadata_deserializes_successfully.json | 2 +- ...your_organization_returns_OK_response.json | 2 +- ...te_Scanning_Group_returns_OK_response.json | 2 +- ...ing_Rule_returns_Bad_Request_response.json | 4 +- ...ate_Scanning_Rule_returns_OK_response.json | 4 +- ...te_Scanning_Group_returns_OK_response.json | 4 +- ...ete_Scanning_Rule_returns_OK_response.json | 4 +- ...plication_returns_No_Content_response.json | 2 +- ...figuration_policy_returns_OK_response.json | 2 +- ...figuration_policy_returns_OK_response.json | 2 +- ...returns_Unprocessable_Entity_response.json | 2 +- ...a_RUM_application_returns_OK_response.json | 2 +- ...figuration_policy_returns_OK_response.json | 2 +- ...guration_policies_returns_OK_response.json | 2 +- ...mission_to_a_role_returns_OK_response.json | 2 +- ...t_Scanning_Groups_returns_OK_response.json | 6 +- ...ssions_for_a_role_returns_OK_response.json | 2 +- .../List_permissions_returns_OK_response.json | 2 +- ...r_Groups_returns_Bad_Request_response.json | 4 +- ...rmission_returns_Bad_Request_response.json | 2 +- ...Revoke_permission_returns_OK_response.json | 2 +- ...te_Scanning_Group_returns_OK_response.json | 4 +- ...ing_Rule_returns_Bad_Request_response.json | 4 +- ...ate_Scanning_Rule_returns_OK_response.json | 2 +- ...a_RUM_application_returns_OK_response.json | 2 +- ...returns_Unprocessable_Entity_response.json | 2 +- ...e_a_role_returns_Bad_Role_ID_response.json | 2 +- ...ate_a_role_returns_Not_found_response.json | 2 +- .../v2/Update_a_role_returns_OK_response.json | 2 +- 34 files changed, 178 insertions(+), 98 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index ba4e46d8be7..c1598ac2b8f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-14 18:05:16.592641", - "spec_repo_commit": "5742ed5d" + "regenerated": "2023-03-15 16:38:18.876838", + "spec_repo_commit": "315984bc" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-14 18:05:16.604691", - "spec_repo_commit": "5742ed5d" + "regenerated": "2023-03-15 16:38:18.889584", + "spec_repo_commit": "315984bc" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bfb064d81e3..93505015259 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18105,7 +18105,24 @@ paths: - Security Rules: `security-rule` - - Service Level Objectives: `slo`' + - Service Level Objectives: `slo` + + + #### Supported relations for resources + + Resource Type | Supported Relations + + -------------------------|-------------------------- + + Connections | `viewer`, `editor`, `resolver` + + Dashboards | `viewer`, `editor` + + Notebooks | `viewer`, `editor` + + Security Rules | `viewer`, `editor` + + Service Level Objectives | `viewer`, `editor`' operationId: UpdateRestrictionPolicy parameters: - $ref: '#/components/parameters/ResourceID' diff --git a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java index e578863ad77..81e9e68a7d6 100644 --- a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java @@ -381,6 +381,14 @@ public CompletableFuture updateRestrictionPolicyAsync * connection - Dashboards: dashboard - Notebooks: notebook - * Security Rules: security-rule - Service Level Objectives: slo * + *

Supported relations for resources

+ * + *

Resource Type | Supported Relations -------------------------|-------------------------- + * Connections | viewer, editor, resolver Dashboards | + * viewer, editor Notebooks | viewer, editor + * Security Rules | viewer, editor Service Level Objectives | + * viewer, editor + * * @param resourceId Identifier, formatted as type:id. Supported types: * connection, dashboard, notebook, security-rule * , slo. (required) diff --git a/src/test/java/com/datadog/api/ClientSteps.java b/src/test/java/com/datadog/api/ClientSteps.java index abc52452163..9cfe87eb015 100644 --- a/src/test/java/com/datadog/api/ClientSteps.java +++ b/src/test/java/com/datadog/api/ClientSteps.java @@ -55,9 +55,12 @@ public void setupVersion(Scenario scenario) { @Before(order = 10) public void setupClient() - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { world.setupClient(apiVersion); } @@ -97,24 +100,31 @@ public void undo() { @Given("an instance of {string} API") public void anInstanceOfAPI(String apiName) - throws java.lang.ClassNotFoundException, java.lang.NoSuchFieldException, - java.lang.InstantiationException, java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { + throws java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException, + java.lang.InstantiationException, + java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException { world.setupAPI(apiVersion, World.toClassName(apiName)); } @Given("operation {string} enabled") public void operationEnabled(String operationId) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { world.setUnstableOperationEnabled(apiVersion + "." + World.toMethodName(operationId)); } @Given("a valid \"apiKeyAuth\" key in the system") public void aValidApiKeyInTheSystem() - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { HashMap secrets = new HashMap(); secrets.put("apiKeyAuth", System.getenv(TEST_API_KEY_NAME)); @@ -123,8 +133,10 @@ public void aValidApiKeyInTheSystem() @Given("a valid \"appKeyAuth\" key in the system") public void aValidAppKeyInTheSystem() - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { HashMap secrets = new HashMap(); secrets.put("appKeyAuth", System.getenv(TEST_APP_KEY_NAME)); @@ -133,23 +145,29 @@ public void aValidAppKeyInTheSystem() @Given("new {string} request") public void newRequest(String methodName) - throws java.lang.IllegalAccessException, java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { + throws java.lang.IllegalAccessException, + java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException { world.newRequest(methodName); } @Given("request contains {string} parameter from {string}") public void requestContainsParameterFrom(String parameterName, String fixturePath) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { world.addRequestParameterFixture(parameterName, fixturePath); } @Given("request contains {string} parameter with value {}") public void requestContainsParameterWithValue(String parameterName, String value) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { world.addRequestParameter(parameterName, value); @@ -157,8 +175,10 @@ public void requestContainsParameterWithValue(String parameterName, String value @Given("body with value {}") public void setBody(String data) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { world.addRequestParameter("body", data); @@ -166,9 +186,12 @@ public void setBody(String data) @Given("body from file {string}") public void setBodyFromFile(String filename) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException, IOException { + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, + java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException, + IOException { Path bodyPath = Paths.get("src/test/resources/com/datadog/api/client/" + apiVersion + "/api/" + filename); String data = new String(Files.readAllBytes(bodyPath)); @@ -177,8 +200,10 @@ public void setBodyFromFile(String filename) @Then("the response status is {int} {}") public void theResponseStatusIs(Integer statusCode, String unused) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { Integer responseStatusCode = (Integer) 0; @@ -195,10 +220,14 @@ public void theResponseStatusIs(Integer statusCode, String unused) @Then("the response {string} is equal to {}") public void theResponseIsEqualTo(String responsePath, String value) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, com.fasterxml.jackson.core.JsonProcessingException { + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + com.fasterxml.jackson.core.JsonProcessingException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); Object responseValue = World.lookup(responseData, responsePath); if (responseValue != null) { @@ -215,18 +244,24 @@ public void theResponseIsEqualTo(String responsePath, String value) @Then("the response {string} is false") public void theResponseIsFalse(String responsePath) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); assertFalse((Boolean) World.lookup(responseData, responsePath)); } @Then("the response {string} has the same value as {string}") public void theResponseHasTheSameValueAs(String responsePath, String fixturePath) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); assertEquals( World.lookup(world.context, fixturePath), World.lookup(responseData, responsePath)); @@ -234,9 +269,12 @@ public void theResponseHasTheSameValueAs(String responsePath, String fixturePath @Then("the response {string} has length {long}") public void theResponseHasLength(String responsePath, Long size) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); List value = (List) World.lookup(responseData, responsePath); assertEquals(size, Long.valueOf(value.size())); @@ -244,7 +282,8 @@ public void theResponseHasLength(String responsePath, Long size) @Then("the response has {int} items") public void theResponseHasItems(Integer size) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, java.lang.NoSuchMethodException { if (world.response.getClass().getSimpleName().equals("PaginationIterable")) { assertEquals(size, ((Object) world.paginatedItems.size())); diff --git a/src/test/java/com/datadog/api/World.java b/src/test/java/com/datadog/api/World.java index 97e93eafb97..190c5bd4f4c 100644 --- a/src/test/java/com/datadog/api/World.java +++ b/src/test/java/com/datadog/api/World.java @@ -133,9 +133,12 @@ public String getVersion() { } private void configureClient(Class clientClass, Object client) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { // client.setServerIndex(0); clientClass.getMethod("setServerIndex", Integer.class).invoke(client, 0); @@ -189,9 +192,12 @@ private void configureClient(Class clientClass, Object client) } public void setupClient(String apiVersion) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, - java.lang.InstantiationException, java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, + java.lang.InstantiationException, + java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, + java.lang.NoSuchFieldException { // import com.datadog.api.client.ApiClient clientClass = Class.forName("com.datadog.api.client.ApiClient"); // client = new ApiClient() @@ -200,8 +206,10 @@ public void setupClient(String apiVersion) } public void setupAPI(String apiVersion, String apiName) - throws java.lang.ClassNotFoundException, java.lang.InstantiationException, - java.lang.IllegalAccessException, java.lang.NoSuchMethodException, + throws java.lang.ClassNotFoundException, + java.lang.InstantiationException, + java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { // import com.datadog.api.{{ apiVersion }}.client.api.{{ apiName }}Api apiClass = Class.forName("com.datadog.api.client." + apiVersion + ".api." + apiName + "Api"); @@ -210,7 +218,8 @@ public void setupAPI(String apiVersion, String apiName) } public void setUnstableOperationEnabled(String operationId) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, java.lang.NoSuchMethodException { // client.setUnstableOperationEnabled(operationId, true) clientClass @@ -219,14 +228,16 @@ public void setUnstableOperationEnabled(String operationId) } public void configureApiKeys(Map secrets) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, java.lang.NoSuchMethodException { // client.configureApiKeys(secrets) clientClass.getMethod("configureApiKeys", Map.class).invoke(client, secrets); } public void authenticateClient(Class clientClass, Object client) - throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, + java.lang.IllegalAccessException, java.lang.NoSuchMethodException { HashMap secrets = new HashMap(); @@ -258,8 +269,10 @@ public void newRequest(String name) { } public void addRequestParameter(String parameterName, String value) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { String propertyName = toPropertyName(parameterName); Class fieldType = null; @@ -294,8 +307,10 @@ public void addRequestParameter(String parameterName, String value) } public void addRequestParameterFixture(String parameterName, String fixturePath) - throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, - java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { + throws java.lang.IllegalAccessException, + java.lang.NoSuchFieldException, + java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException { String propertyName = toPropertyName(parameterName); Class fieldType = null; boolean isOptional = false; @@ -571,7 +586,8 @@ public void sendPaginatedRequest() throws Exception { } public ObjectMapper getObjectMapper() - throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { Method getJSON = clientClass.getMethod("getJSON"); Object json = getJSON.invoke(client); diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json index 0b1cdf6a6a8..dbf89c929d7 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json index 91c8275f382..e94edfb7099 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json index 31da0312ba7..acedc012d64 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e79" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json index 8d602e9c738..75696feb97f 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7e" + "id": "01611a93-5e74-0630-3c51-f707c3b51e79" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json index 214a7cbe719..209376a9d10 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json index 6614fd25132..df46f38cbc4 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" + "id": "01611a93-5e74-0630-3c51-f707c3b51e78" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json index 2236d2e23a5..751974cd6f6 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json index 99ef53d9ce7..9d6c37d2673 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0685" + "id": "74945625-c01a-a598-e538-65a53ceb0687" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_a_monitor_configuration_policy_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_monitor_configuration_policy_returns_OK_response.json index d822b0523ff..2c4fa09192e 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_monitor_configuration_policy_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_monitor_configuration_policy_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "13b530fd-8b91-17a8-9930-69a27759db42" + "id": "13b530fd-8b91-17a8-9930-69a27759db41" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_OK_response.json index 4f9e14d270f..8b97ba06ad0 100644 --- a/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "13b530fd-8b91-17a8-9930-69a27759db40" + "id": "13b530fd-8b91-17a8-9930-69a27759db42" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_Unprocessable_Entity_response.json b/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_Unprocessable_Entity_response.json index fe0a7c5d947..92c692ec68b 100644 --- a/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_Unprocessable_Entity_response.json +++ b/src/test/resources/cassettes/features/v2/Edit_a_monitor_configuration_policy_returns_Unprocessable_Entity_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "13b530fd-8b91-17a8-9930-69a27759db41" + "id": "13b530fd-8b91-17a8-9930-69a27759db44" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json index 135cc1ef131..9aead012302 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0688" + "id": "74945625-c01a-a598-e538-65a53ceb0686" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_monitor_configuration_policy_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_monitor_configuration_policy_returns_OK_response.json index 7f095b2d93f..e6bc4a8ef9d 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_monitor_configuration_policy_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_monitor_configuration_policy_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "13b530fd-8b91-17a8-9930-69a27759db43" + "id": "13b530fd-8b91-17a8-9930-69a27759db40" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_all_monitor_configuration_policies_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_monitor_configuration_policies_returns_OK_response.json index ec13d1e8280..637ec34f5b9 100644 --- a/src/test/resources/cassettes/features/v2/Get_all_monitor_configuration_policies_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_all_monitor_configuration_policies_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "13b530fd-8b91-17a8-9930-69a27759db44" + "id": "13b530fd-8b91-17a8-9930-69a27759db43" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json index e32919549c5..feb6f26376a 100644 --- a/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" + "id": "ab2c08c1-60c7-9278-3246-d650bb892170" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json index ae02bc3a8a1..fded7c80ab4 100644 --- a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" + "id": "01611a93-5e74-0630-3c51-f707c3b51e81" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" }, { "httpRequest": { @@ -79,7 +79,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" + "id": "01611a93-5e74-0630-3c51-f707c3b51e82" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json index 06f08e8303c..9affa9bad69 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892171" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json index b11612d8018..069d3e1c02b 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892172" + "id": "ab2c08c1-60c7-9278-3246-d650bb892173" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json index 6bdde488c0b..a6d91d6360c 100644 --- a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e81" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7e" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Bad_Request_response.json index e9b614a7caf..9a296f711cd 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Bad_Request_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892170" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216f" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json index c4b0317c4ec..3d4a313e907 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892173" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json index 03f59af1021..a4bf3779607 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e78" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json index 2b7589dcba5..d55214cdb27 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e82" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json index 68c770413e2..5171c1cf06f 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json index d8d637f2962..e93acc76609 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0687" + "id": "74945625-c01a-a598-e538-65a53ceb0688" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json index 8a61f2abca2..af7b4883977 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0686" + "id": "74945625-c01a-a598-e538-65a53ceb0685" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json index f2ac334f873..93925f760d1 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892175" + "id": "ab2c08c1-60c7-9278-3246-d650bb892172" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json index a79813863cc..dc2bf2721e3 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216f" + "id": "ab2c08c1-60c7-9278-3246-d650bb892171" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json index d401147456f..a2c46537cd2 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" + "id": "ab2c08c1-60c7-9278-3246-d650bb892175" }, { "httpRequest": { From d7c54baaf06ddaf2e026728d60cf85efd56bb4fc Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 15 Mar 2023 16:41:30 +0000 Subject: [PATCH 2/2] pre-commit fixes --- .../java/com/datadog/api/ClientSteps.java | 117 ++++++------------ src/test/java/com/datadog/api/World.java | 48 +++---- 2 files changed, 55 insertions(+), 110 deletions(-) diff --git a/src/test/java/com/datadog/api/ClientSteps.java b/src/test/java/com/datadog/api/ClientSteps.java index 9cfe87eb015..abc52452163 100644 --- a/src/test/java/com/datadog/api/ClientSteps.java +++ b/src/test/java/com/datadog/api/ClientSteps.java @@ -55,12 +55,9 @@ public void setupVersion(Scenario scenario) { @Before(order = 10) public void setupClient() - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { world.setupClient(apiVersion); } @@ -100,31 +97,24 @@ public void undo() { @Given("an instance of {string} API") public void anInstanceOfAPI(String apiName) - throws java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException, - java.lang.InstantiationException, - java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException { + throws java.lang.ClassNotFoundException, java.lang.NoSuchFieldException, + java.lang.InstantiationException, java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { world.setupAPI(apiVersion, World.toClassName(apiName)); } @Given("operation {string} enabled") public void operationEnabled(String operationId) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { world.setUnstableOperationEnabled(apiVersion + "." + World.toMethodName(operationId)); } @Given("a valid \"apiKeyAuth\" key in the system") public void aValidApiKeyInTheSystem() - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { HashMap secrets = new HashMap(); secrets.put("apiKeyAuth", System.getenv(TEST_API_KEY_NAME)); @@ -133,10 +123,8 @@ public void aValidApiKeyInTheSystem() @Given("a valid \"appKeyAuth\" key in the system") public void aValidAppKeyInTheSystem() - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { HashMap secrets = new HashMap(); secrets.put("appKeyAuth", System.getenv(TEST_APP_KEY_NAME)); @@ -145,29 +133,23 @@ public void aValidAppKeyInTheSystem() @Given("new {string} request") public void newRequest(String methodName) - throws java.lang.IllegalAccessException, - java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException { + throws java.lang.IllegalAccessException, java.lang.IllegalAccessException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { world.newRequest(methodName); } @Given("request contains {string} parameter from {string}") public void requestContainsParameterFrom(String parameterName, String fixturePath) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, - java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { world.addRequestParameterFixture(parameterName, fixturePath); } @Given("request contains {string} parameter with value {}") public void requestContainsParameterWithValue(String parameterName, String value) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, - java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { world.addRequestParameter(parameterName, value); @@ -175,10 +157,8 @@ public void requestContainsParameterWithValue(String parameterName, String value @Given("body with value {}") public void setBody(String data) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, - java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { world.addRequestParameter("body", data); @@ -186,12 +166,9 @@ public void setBody(String data) @Given("body from file {string}") public void setBodyFromFile(String filename) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.ClassNotFoundException, - java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException, - IOException { + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, + java.lang.reflect.InvocationTargetException, IOException { Path bodyPath = Paths.get("src/test/resources/com/datadog/api/client/" + apiVersion + "/api/" + filename); String data = new String(Files.readAllBytes(bodyPath)); @@ -200,10 +177,8 @@ public void setBodyFromFile(String filename) @Then("the response status is {int} {}") public void theResponseStatusIs(Integer statusCode, String unused) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException { Integer responseStatusCode = (Integer) 0; @@ -220,14 +195,10 @@ public void theResponseStatusIs(Integer statusCode, String unused) @Then("the response {string} is equal to {}") public void theResponseIsEqualTo(String responsePath, String value) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - com.fasterxml.jackson.core.JsonProcessingException { + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, com.fasterxml.jackson.core.JsonProcessingException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); Object responseValue = World.lookup(responseData, responsePath); if (responseValue != null) { @@ -244,24 +215,18 @@ public void theResponseIsEqualTo(String responsePath, String value) @Then("the response {string} is false") public void theResponseIsFalse(String responsePath) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); assertFalse((Boolean) World.lookup(responseData, responsePath)); } @Then("the response {string} has the same value as {string}") public void theResponseHasTheSameValueAs(String responsePath, String fixturePath) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); assertEquals( World.lookup(world.context, fixturePath), World.lookup(responseData, responsePath)); @@ -269,12 +234,9 @@ public void theResponseHasTheSameValueAs(String responsePath, String fixturePath @Then("the response {string} has length {long}") public void theResponseHasLength(String responsePath, Long size) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { Object responseData = world.responseClass.getMethod("getData").invoke(world.response); List value = (List) World.lookup(responseData, responsePath); assertEquals(size, Long.valueOf(value.size())); @@ -282,8 +244,7 @@ public void theResponseHasLength(String responsePath, Long size) @Then("the response has {int} items") public void theResponseHasItems(Integer size) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException { if (world.response.getClass().getSimpleName().equals("PaginationIterable")) { assertEquals(size, ((Object) world.paginatedItems.size())); diff --git a/src/test/java/com/datadog/api/World.java b/src/test/java/com/datadog/api/World.java index 190c5bd4f4c..97e93eafb97 100644 --- a/src/test/java/com/datadog/api/World.java +++ b/src/test/java/com/datadog/api/World.java @@ -133,12 +133,9 @@ public String getVersion() { } private void configureClient(Class clientClass, Object client) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { // client.setServerIndex(0); clientClass.getMethod("setServerIndex", Integer.class).invoke(client, 0); @@ -192,12 +189,9 @@ private void configureClient(Class clientClass, Object client) } public void setupClient(String apiVersion) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, - java.lang.InstantiationException, - java.lang.NoSuchMethodException, - java.lang.ClassNotFoundException, - java.lang.NoSuchFieldException { + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, + java.lang.InstantiationException, java.lang.NoSuchMethodException, + java.lang.ClassNotFoundException, java.lang.NoSuchFieldException { // import com.datadog.api.client.ApiClient clientClass = Class.forName("com.datadog.api.client.ApiClient"); // client = new ApiClient() @@ -206,10 +200,8 @@ public void setupClient(String apiVersion) } public void setupAPI(String apiVersion, String apiName) - throws java.lang.ClassNotFoundException, - java.lang.InstantiationException, - java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, + throws java.lang.ClassNotFoundException, java.lang.InstantiationException, + java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { // import com.datadog.api.{{ apiVersion }}.client.api.{{ apiName }}Api apiClass = Class.forName("com.datadog.api.client." + apiVersion + ".api." + apiName + "Api"); @@ -218,8 +210,7 @@ public void setupAPI(String apiVersion, String apiName) } public void setUnstableOperationEnabled(String operationId) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException { // client.setUnstableOperationEnabled(operationId, true) clientClass @@ -228,16 +219,14 @@ public void setUnstableOperationEnabled(String operationId) } public void configureApiKeys(Map secrets) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException { // client.configureApiKeys(secrets) clientClass.getMethod("configureApiKeys", Map.class).invoke(client, secrets); } public void authenticateClient(Class clientClass, Object client) - throws java.lang.reflect.InvocationTargetException, - java.lang.IllegalAccessException, + throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException { HashMap secrets = new HashMap(); @@ -269,10 +258,8 @@ public void newRequest(String name) { } public void addRequestParameter(String parameterName, String value) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException, + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, com.fasterxml.jackson.core.JsonProcessingException { String propertyName = toPropertyName(parameterName); Class fieldType = null; @@ -307,10 +294,8 @@ public void addRequestParameter(String parameterName, String value) } public void addRequestParameterFixture(String parameterName, String fixturePath) - throws java.lang.IllegalAccessException, - java.lang.NoSuchFieldException, - java.lang.NoSuchMethodException, - java.lang.reflect.InvocationTargetException { + throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException, + java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { String propertyName = toPropertyName(parameterName); Class fieldType = null; boolean isOptional = false; @@ -586,8 +571,7 @@ public void sendPaginatedRequest() throws Exception { } public ObjectMapper getObjectMapper() - throws java.lang.IllegalAccessException, - java.lang.NoSuchMethodException, + throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException { Method getJSON = clientClass.getMethod("getJSON"); Object json = getJSON.invoke(client);