SOP: Add test to ensure that armoring already-armored data is idempotent

This commit is contained in:
Paul Schaub 2022-11-17 14:28:29 +01:00
parent 6ba7e91f2a
commit b9152d5cde
1 changed files with 10 additions and 0 deletions

View File

@ -97,4 +97,14 @@ public class ArmorCmdTest extends CLITest {
assertEquals(SOPGPException.UnsupportedOption.EXIT_CODE, exitCode);
assertEquals(0, out.size());
}
@Test
public void armorAlreadyArmoredDataIsIdempotent() throws IOException {
pipeStringToStdin(key);
ByteArrayOutputStream armorOut = pipeStdoutToStream();
assertSuccess(executeCommand("armor"));
String armored = armorOut.toString();
assertEquals(key, armored);
}
}