Skip to content

Commit

Permalink
No point running tests without native
Browse files Browse the repository at this point in the history
Also tests for CRYPTO-178
  • Loading branch information
sebbASF committed Nov 20, 2023
1 parent 1a1a41b commit 514a0e3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
import java.util.Properties;

import org.apache.commons.crypto.Crypto;
import org.junit.jupiter.api.BeforeAll;

public class OpenSslCryptoRandomTest extends AbstractRandomTest {

@BeforeAll
public static void beforeAll() {
assumeTrue(Crypto.isNativeCodeLoaded());
assumeTrue(OpenSslCryptoRandom.isNativeCodeEnabled()); // should not throw
}

@Override
public CryptoRandom getCryptoRandom() throws GeneralSecurityException {
assumeTrue(Crypto.isNativeCodeLoaded());
final Properties props = new Properties();
props.setProperty(CryptoRandomFactory.CLASSES_KEY, OpenSslCryptoRandom.class.getName());
final CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
Expand Down

0 comments on commit 514a0e3

Please sign in to comment.