Reference exit codes directly in junit tests

This commit is contained in:
Paul Schaub 2022-06-11 11:18:45 +02:00
parent 0c24c2301d
commit 61ab35ad52
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
11 changed files with 72 additions and 63 deletions

View file

@ -68,7 +68,7 @@ public class ExtractCertCmdTest {
}
@Test
@ExpectSystemExitWithStatus(41)
@ExpectSystemExitWithStatus(SOPGPException.BadData.EXIT_CODE)
public void key_badDataCausesExit41() throws IOException, SOPGPException.BadData {
when(extractCert.key((InputStream) any())).thenThrow(new SOPGPException.BadData(new IOException()));
SopCLI.main(new String[] {"extract-cert"});