From c96028a2ae717c7c5d10786bb3c8650a2cc9cbf8 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Fri, 4 May 2018 09:27:39 +0200 Subject: [PATCH] Cleanup unused variables --- .../compute/config/AzurePredicatesModule.java | 6 ----- .../arm/features/VaultApiLiveTest.java | 23 +++++-------------- .../arm/features/VaultApiMockTest.java | 3 --- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/config/AzurePredicatesModule.java b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/config/AzurePredicatesModule.java index c8dfd6e860..98850758fb 100644 --- a/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/config/AzurePredicatesModule.java +++ b/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/config/AzurePredicatesModule.java @@ -330,7 +330,6 @@ public class AzurePredicatesModule extends AbstractModule { @Override public boolean apply(final String name) { checkNotNull(name, "name cannot be null"); - boolean present = false; List vaults = api.getVaultApi(resourceGroup).listDeletedVaults(); return shouldBePresent == Iterables.any(vaults, new Predicate() { @Override public boolean apply(Vault.DeletedVault input) { @@ -380,7 +379,6 @@ public class AzurePredicatesModule extends AbstractModule { @Override public boolean apply(final String name) { checkNotNull(name, "name cannot be null"); - boolean present = false; DeletedKeyBundle key = api.getVaultApi(resourceGroup).getDeletedKey(vaultUri, name); return shouldBePresent == (key != null); } @@ -408,7 +406,6 @@ public class AzurePredicatesModule extends AbstractModule { @Override public boolean apply(final String name) { checkNotNull(name, "name cannot be null"); - boolean result = false; KeyBundle key = api.getVaultApi(resourceGroup).getKey(vaultUri, name); return key != null ? (isRecovered ? true : key.attributes().recoveryLevel().contains("Recoverable")) : false; } @@ -453,7 +450,6 @@ public class AzurePredicatesModule extends AbstractModule { return retry(new Predicate() { @Override public boolean apply(final String name) { - boolean present = false; checkNotNull(name, "name cannot be null"); DeletedSecretBundle secret = api.getVaultApi(resourceGroup).getDeletedSecret(vaultUri, name); return shouldBePresent == (secret != null); @@ -534,7 +530,6 @@ public class AzurePredicatesModule extends AbstractModule { return retry(new Predicate() { @Override public boolean apply(final String name) { - boolean present = false; checkNotNull(name, "name cannot be null"); DeletedCertificateBundle cert = api.getVaultApi(resourceGroup).getDeletedCertificate(vaultUri, name); return shouldBePresent == (cert != null); @@ -591,7 +586,6 @@ public class AzurePredicatesModule extends AbstractModule { @Override public boolean apply(final String name) { checkNotNull(name, "name cannot be null"); - boolean result = false; CertificateOperation certOp = api.getVaultApi(resourceGroup).getCertificateOperation(vaultUri, name); return isCreate ? ((certOp != null) ? !certOp.status().equals("inProgress") : false) : (certOp == null); } diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiLiveTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiLiveTest.java index 026aa2863a..2c6b10084c 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiLiveTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiLiveTest.java @@ -318,17 +318,6 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = "testUpdateKey") public void testListKeyVersions() { - // Create a second version of the key - KeyAttributes keyAttr = KeyAttributes.create(true, null, null, null, null, null); - KeyBundle keyBundle = api().createKey(vaultUri, - KEY_NAME, - keyAttr, - null, - null, - 3072, - "RSA", - null); - // List key versions List keys = api().getKeyVersions(vaultUri, KEY_NAME); assertNotNull(keys); @@ -427,7 +416,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = {"testDeleteRecoverableKey", "testGetDeletedKey"}) public void testRecoverDeletedKey() { - KeyBundle key = api().recoverDeletedKey(vaultUri, RECOVERABLE_KEY_NAME); + api().recoverDeletedKey(vaultUri, RECOVERABLE_KEY_NAME); checkState(recoverableKeyStatus.create(resourceGroupName, vaultUri, true).apply(RECOVERABLE_KEY_NAME), "key was not recovered before timeout"); } @@ -435,7 +424,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = "testRecoverDeletedKey") public void testPurgeDeletedKey() { // delete the key - DeletedKeyBundle dkb = api().deleteKey(vaultUri, RECOVERABLE_KEY_NAME); + api().deleteKey(vaultUri, RECOVERABLE_KEY_NAME); checkState(deletedKeyStatus.create(resourceGroupName, vaultUri, true).apply(RECOVERABLE_KEY_NAME), "key was not deleted before timeout"); @@ -559,7 +548,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { public void testListSecretVersions() { // Create a second version of the secret SecretAttributes attributes = SecretAttributes.create(true, null, null, null, null, null); - SecretBundle secretBundle = api().setSecret(vaultUri, + api().setSecret(vaultUri, SECRET_NAME, attributes, "aNewSecretKey", @@ -684,7 +673,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = {"testDeleteRecoverableSecret", "testGetDeletedSecret"}) public void testRecoverDeletedSecret() { - SecretBundle secret = api().recoverDeletedSecret(vaultUri, RECOVERABLE_SECRET_NAME); + api().recoverDeletedSecret(vaultUri, RECOVERABLE_SECRET_NAME); checkState(recoverableSecretStatus.create(resourceGroupName, vaultUri, true).apply(RECOVERABLE_SECRET_NAME), "secret was not created before timeout"); } @@ -692,7 +681,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = "testRecoverDeletedSecret") public void testPurgeDeletedSecret() { // delete the secret - DeletedSecretBundle dsb = api().deleteSecret(vaultUri, RECOVERABLE_SECRET_NAME); + api().deleteSecret(vaultUri, RECOVERABLE_SECRET_NAME); checkState(deletedSecretStatus.create(resourceGroupName, vaultUri, true).apply(RECOVERABLE_SECRET_NAME), "secret was not deleted before timeout"); @@ -1041,7 +1030,7 @@ public class VaultApiLiveTest extends BaseAzureComputeApiLiveTest { @Test(dependsOnMethods = "testRecoverDeletedCertificate") public void testPurgeDeletedCertificate() { // delete the certificate - DeletedCertificateBundle dcb = api().deleteCertificate(vaultUri, RECOVERABLE_CERTIFICATE_NAME); + api().deleteCertificate(vaultUri, RECOVERABLE_CERTIFICATE_NAME); checkState(deletedCertificateStatus.create(resourceGroupName, vaultUri, true).apply(RECOVERABLE_CERTIFICATE_NAME), "certificate was not deleted before timeout"); diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiMockTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiMockTest.java index 7459f4812d..be3ae74c7e 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiMockTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VaultApiMockTest.java @@ -84,15 +84,12 @@ public class VaultApiMockTest extends BaseAzureComputeApiMockTest { private URI vaultUri; private static String KEY_NAME = "myKey"; - private static String TEMP_KEY_NAME = "myTempKey"; private static String IMPORT_KEY_NAME = "myImportKey"; private static String RECOVERABLE_KEY_NAME = "myRecoverableKey"; private static String SECRET_NAME = "mySecret"; private static String RECOVERABLE_SECRET_NAME = "myRecoverableSecret"; private static String CERTIFICATE_NAME = "myCertificate"; - private static String TEMP_CERTIFICATE_NAME = "myTempCertificate"; private static String RECOVERABLE_CERTIFICATE_NAME = "myRecoverableCertificate"; - private static String IMPORTABLE_CERTIFICATE_NAME = "myImportableCertificate"; private static String CERTIFICATE_ISSUER_NAME = "globalsign01"; private String IMPORTABLE_CERTIFICATE_PEM = stringFromResource("/vaultimportablecert.txt"); private String sampleSecret = stringFromResource("/vaultsamplesecret.txt");