1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-06 20:31:08 +01:00

Policy is no longer a Singleton

This commit is contained in:
Paul Schaub 2025-03-20 20:17:50 +01:00
parent b24d0ef99c
commit 2d42457ce4
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
5 changed files with 26 additions and 31 deletions

View file

@ -17,43 +17,43 @@ public class PolicySetterTest {
@Test
public void testSetCertificationSignatureHashAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withCertificationSignatureHashAlgorithmPolicy(null));
}
@Test
public void testSetDataSignatureHashAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withDataSignatureHashAlgorithmPolicy(null));
}
@Test
public void testSetRevocationSignatureHashAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withRevocationSignatureHashAlgorithmPolicy(null));
}
@Test
public void testSetSymmetricKeyEncryptionAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withSymmetricKeyEncryptionAlgorithmPolicy(null));
}
@Test
public void testSetSymmetricKeyDecryptionAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withSymmetricKeyDecryptionAlgorithmPolicy(null));
}
@Test
public void testSetCompressionAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withCompressionAlgorithmPolicy(null));
}
@Test
public void testSetPublicKeyAlgorithmPolicy_NullFails() {
Policy policy = Policy.getInstance();
Policy policy = new Policy();
assertThrows(NullPointerException.class, () -> policy.copy().withPublicKeyAlgorithmPolicy(null));
}