Skip to content

Commit

Permalink
testAddSnapshotLifecyclePolicy drop unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidan committed Sep 19, 2019
1 parent 32fa9d7 commit af42449
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -820,6 +818,7 @@ public void testAddSnapshotLifecyclePolicy() throws Exception {
public void onResponse(GetSnapshotLifecyclePolicyResponse resp) {
Map<String, SnapshotLifecyclePolicyMetadata> policies =
resp.getPolicies(); // <1>
assertThat(policies.size(), equalTo(1));
}

@Override
Expand All @@ -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<String, Object> snapshotConfiguration = retrievedPolicy.getConfig();
// end::slm-get-snapshot-lifecycle-policy-response

assertNotNull(policyMeta);
Expand Down

0 comments on commit af42449

Please sign in to comment.