mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-18 02:12:06 +01:00
Add tests for ListProfilesCmd
This commit is contained in:
parent
d9ab91516d
commit
7f5bc91f6b
1 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,42 @@
|
|||
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.cli.commands;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ListProfilesCmdTest extends CLITest {
|
||||
|
||||
public ListProfilesCmdTest() {
|
||||
super(LoggerFactory.getLogger(ListProfilesCmdTest.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listProfilesWithoutCommand() throws IOException {
|
||||
assertNotEquals(0, executeCommand("list-profiles"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listProfileOfGenerateKey() throws IOException {
|
||||
ByteArrayOutputStream output = pipeStdoutToStream();
|
||||
assertSuccess(executeCommand("list-profiles", "generate-key"));
|
||||
|
||||
assertTrue(output.toString().contains("rfc4880"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listProfilesOfEncrypt() throws IOException {
|
||||
ByteArrayOutputStream output = pipeStdoutToStream();
|
||||
assertSuccess(executeCommand("list-profiles", "encrypt"));
|
||||
|
||||
assertTrue(output.toString().contains("rfc4880"));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue