This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git
The following commit(s) were added to refs/heads/master by this push:
new 674f4053 Explain why NSM generated; better name
674f4053 is described below
commit 674f405369690ab89c68e9ee7062552a8122fdca
Author: Sebb <[email protected]>
AuthorDate: Tue Nov 21 22:24:55 2023 +0000
Explain why NSM generated; better name
[skip ci]
---
.../org/apache/commons/crypto/random/CryptoRandomFactoryTest.java | 4 ++--
.../random/{NoopRandom.java => MissingPropertyCtrRandom.java} | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
b/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
index 11194831..3b201762 100644
---
a/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
+++
b/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
@@ -61,9 +61,9 @@ public class CryptoRandomFactoryTest {
}
@Test
- public void testDummmyRandom() {
+ public void testMissingPropertyCtrRandomRandom() {
final Properties properties = new Properties();
- properties.setProperty(CryptoRandomFactory.CLASSES_KEY,
NoopRandom.class.getName());
+ properties.setProperty(CryptoRandomFactory.CLASSES_KEY,
MissingPropertyCtrRandom.class.getName());
final Exception ex = assertThrows(GeneralSecurityException.class, ()
-> CryptoRandomFactory.getCryptoRandom(properties));
final String message = ex.getMessage();
assertTrue(message.contains("NoSuchMethodException"), message);
diff --git a/src/test/java/org/apache/commons/crypto/random/NoopRandom.java
b/src/test/java/org/apache/commons/crypto/random/MissingPropertyCtrRandom.java
similarity index 83%
rename from src/test/java/org/apache/commons/crypto/random/NoopRandom.java
rename to
src/test/java/org/apache/commons/crypto/random/MissingPropertyCtrRandom.java
index b2ccfa55..33443b49 100644
--- a/src/test/java/org/apache/commons/crypto/random/NoopRandom.java
+++
b/src/test/java/org/apache/commons/crypto/random/MissingPropertyCtrRandom.java
@@ -17,10 +17,10 @@
package org.apache.commons.crypto.random;
-final class NoopRandom implements CryptoRandom {
+final class MissingPropertyCtrRandom implements CryptoRandom {
- /** Should fail with NoSuchMethodException. */
- NoopRandom() {
+ /** Should fail with NoSuchMethodException (has no constructor with a
Properties argument). */
+ MissingPropertyCtrRandom() {
// empty
}