From af424496cf603ec0f80fdb764ad8fea4dbcb7977 Mon Sep 17 00:00:00 2001 From: Andrei Dan Date: Thu, 19 Sep 2019 17:12:14 +0100 Subject: [PATCH] testAddSnapshotLifecyclePolicy drop unused variables --- .../client/documentation/ILMDocumentationIT.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ILMDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ILMDocumentationIT.java index ea53b7b165a76..51dd25aa8f36e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ILMDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ILMDocumentationIT.java @@ -800,10 +800,8 @@ public void testAddSnapshotLifecyclePolicy() throws Exception { //////// GET // tag::slm-get-snapshot-lifecycle-policy - GetSnapshotLifecyclePolicyRequest getAllRequest = - new GetSnapshotLifecyclePolicyRequest(); // <1> GetSnapshotLifecyclePolicyRequest getRequest = - new GetSnapshotLifecyclePolicyRequest("policy_id"); // <2> + new GetSnapshotLifecyclePolicyRequest("policy_id"); // end::slm-get-snapshot-lifecycle-policy // tag::slm-get-snapshot-lifecycle-policy-execute @@ -820,6 +818,7 @@ public void testAddSnapshotLifecyclePolicy() throws Exception { public void onResponse(GetSnapshotLifecyclePolicyResponse resp) { Map policies = resp.getPolicies(); // <1> + assertThat(policies.size(), equalTo(1)); } @Override @@ -839,18 +838,7 @@ public void onFailure(Exception e) { SnapshotLifecyclePolicyMetadata policyMeta = getResponse.getPolicies().get("policy_id"); // <1> long policyVersion = policyMeta.getVersion(); - long policyModificationDate = policyMeta.getModifiedDate(); - long nextPolicyExecutionDate = policyMeta.getNextExecution(); - SnapshotInvocationRecord lastSuccess = policyMeta.getLastSuccess(); - SnapshotInvocationRecord lastFailure = policyMeta.getLastFailure(); - SnapshotLifecyclePolicyMetadata.SnapshotInProgress inProgress = - policyMeta.getSnapshotInProgress(); SnapshotLifecyclePolicy retrievedPolicy = policyMeta.getPolicy(); // <2> - String id = retrievedPolicy.getId(); - String snapshotNameFormat = retrievedPolicy.getName(); - String repositoryName = retrievedPolicy.getRepository(); - String schedule = retrievedPolicy.getSchedule(); - Map snapshotConfiguration = retrievedPolicy.getConfig(); // end::slm-get-snapshot-lifecycle-policy-response assertNotNull(policyMeta);