Skip to content

Commit

Permalink
[openpgp] Fix usage of junit annotations in SecretKeyBackupHelperTestc
Browse files Browse the repository at this point in the history
The unit test used the JUnit 4 annotations @BeforeClass and
@afterclass when it should use the JUnit 5 variants @BeforeAll and
@afterall.
  • Loading branch information
Flowdalic committed Nov 19, 2024
1 parent 2e4178d commit 6fe95f4
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.impl.JidCreate;
Expand All @@ -49,14 +49,11 @@

public class SecretKeyBackupHelperTest extends SmackTestSuite {

private static final File basePath;
private static File basePath;

static {
try {
basePath = Files.createTempDirectory("ox_secret_keys_").toFile();
} catch (IOException e) {
throw new AssertionError(e);
}
@BeforeAll
public static void createTemptDir() throws IOException {
basePath = Files.createTempDirectory("ox_secret_keys_").toFile();
}

@Test
Expand Down Expand Up @@ -98,8 +95,7 @@ public void createAndDecryptSecretKeyElementTest()
Assertions.assertArrayEquals(secretKeys.getEncoded(), secretKeyRing.getEncoded());
}

@AfterClass
@BeforeClass
@AfterAll
public static void deleteDirs() throws IOException {
org.apache.commons.io.FileUtils.deleteDirectory(basePath);
}
Expand Down

0 comments on commit 6fe95f4

Please sign in to comment.