Fix unit test

This commit is contained in:
René Pfeuffer
2018-12-06 08:56:57 +01:00
parent c328a94147
commit 226dc75ddc
2 changed files with 18 additions and 5 deletions

View File

@@ -51,6 +51,7 @@ import static com.google.common.base.Preconditions.*;
//~--- JDK imports ------------------------------------------------------------
import java.security.SecureRandom;
import java.util.Random;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -88,12 +89,17 @@ public class SecureKeyResolver extends SigningKeyResolverAdapter
*/
@Inject
@SuppressWarnings("unchecked")
public SecureKeyResolver(ConfigurationEntryStoreFactory storeFactory)
public SecureKeyResolver(ConfigurationEntryStoreFactory storeFactory) {
this(storeFactory, new SecureRandom());
}
SecureKeyResolver(ConfigurationEntryStoreFactory storeFactory, Random random)
{
store = storeFactory
.withType(SecureKey.class)
.withName(STORE_NAME)
.build();
this.random = random;
}
//~--- methods --------------------------------------------------------------
@@ -163,7 +169,7 @@ public class SecureKeyResolver extends SigningKeyResolverAdapter
//~--- fields ---------------------------------------------------------------
/** secure randon */
private final SecureRandom random = new SecureRandom();
private final Random random;
/** configuration entry store */
private final ConfigurationEntryStore<SecureKey> store;