From f435fa87e2cbc8d2f2ff81e576f41967a94f9f60 Mon Sep 17 00:00:00 2001 From: Scott Leberknight <174812+sleberknight@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:58:37 -0400 Subject: [PATCH] Suppress removal warnings in Ansible utility tests (#1120) --- .../org/kiwiproject/ansible/vault/VaultDecryptCommandTest.java | 3 +++ .../org/kiwiproject/ansible/vault/VaultEncryptCommandTest.java | 2 ++ .../ansible/vault/VaultEncryptStringCommandTest.java | 2 ++ .../org/kiwiproject/ansible/vault/VaultRekeyCommandTest.java | 1 + .../org/kiwiproject/ansible/vault/VaultViewCommandTest.java | 1 + 5 files changed, 9 insertions(+) diff --git a/src/test/java/org/kiwiproject/ansible/vault/VaultDecryptCommandTest.java b/src/test/java/org/kiwiproject/ansible/vault/VaultDecryptCommandTest.java index bd6df2be..560f82dc 100644 --- a/src/test/java/org/kiwiproject/ansible/vault/VaultDecryptCommandTest.java +++ b/src/test/java/org/kiwiproject/ansible/vault/VaultDecryptCommandTest.java @@ -25,6 +25,7 @@ void setUp() { class ShouldBuildCommand { @Test + @SuppressWarnings("removal") void whenGivenNoOutputFile() { var encryptedFilePath = "/data/secret/MySecret.txt"; var command = VaultDecryptCommand.from(configuration, encryptedFilePath); @@ -42,6 +43,7 @@ void whenGivenNoOutputFile() { } @Test + @SuppressWarnings("removal") void whenGivenOutputFile() { var encryptedFilePath = "/data/secret/MySecret.txt"; var outputFilePath = "/data/temp/Plain.txt"; @@ -62,6 +64,7 @@ void whenGivenOutputFile() { } @Test + @SuppressWarnings("removal") void whenGivenStdOutAsOutputFile() { var encryptedFilePath = "/data/secret/MySecret.txt"; var command = VaultDecryptCommand.toStdoutFrom(configuration, encryptedFilePath); diff --git a/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptCommandTest.java b/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptCommandTest.java index f9b7b47b..f22c72a5 100644 --- a/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptCommandTest.java +++ b/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptCommandTest.java @@ -20,6 +20,7 @@ void setUp() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand() { var plainTextFileName = "/data/etc/secrets/passwords.txt"; @@ -38,6 +39,7 @@ void shouldBuildCommand() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand_WithVaultId() { var vaultIdLabel = "test"; var plainTextFileName = "/data/etc/secrets/passwords.txt"; diff --git a/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptStringCommandTest.java b/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptStringCommandTest.java index 65913132..22f75adc 100644 --- a/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptStringCommandTest.java +++ b/src/test/java/org/kiwiproject/ansible/vault/VaultEncryptStringCommandTest.java @@ -20,6 +20,7 @@ void setUp() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand() { var plainText = "the plain text"; var variableName = "MySecret"; @@ -40,6 +41,7 @@ void shouldBuildCommand() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand_WithVaultId() { var vaultIdLabel = "test"; var plainText = "the plain text"; diff --git a/src/test/java/org/kiwiproject/ansible/vault/VaultRekeyCommandTest.java b/src/test/java/org/kiwiproject/ansible/vault/VaultRekeyCommandTest.java index edd5eeb7..52d324aa 100644 --- a/src/test/java/org/kiwiproject/ansible/vault/VaultRekeyCommandTest.java +++ b/src/test/java/org/kiwiproject/ansible/vault/VaultRekeyCommandTest.java @@ -20,6 +20,7 @@ void setUp() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand() { var encryptedFileName = "/data/crypt/passwords.txt"; var newVaultPasswordFilePath = "/~.ansible/new_vault_pass"; diff --git a/src/test/java/org/kiwiproject/ansible/vault/VaultViewCommandTest.java b/src/test/java/org/kiwiproject/ansible/vault/VaultViewCommandTest.java index 40dbcca2..f8e918e7 100644 --- a/src/test/java/org/kiwiproject/ansible/vault/VaultViewCommandTest.java +++ b/src/test/java/org/kiwiproject/ansible/vault/VaultViewCommandTest.java @@ -20,6 +20,7 @@ void setUp() { } @Test + @SuppressWarnings("removal") void shouldBuildCommand() { var encryptedFileName = "/data/crypt/passwords.txt";