diff --git a/src/main/java/co/rsk/federate/signing/config/SignerType.java b/src/main/java/co/rsk/federate/signing/config/SignerType.java index 6e4473d7..295b74e0 100644 --- a/src/main/java/co/rsk/federate/signing/config/SignerType.java +++ b/src/main/java/co/rsk/federate/signing/config/SignerType.java @@ -16,7 +16,7 @@ public static SignerType fromConfigValue(String configValue) { return signerType; } } - throw new RuntimeException(String.format("Unsupported signer type: %s", configValue)); + throw new IllegalArgumentException(String.format("Unsupported signer type: %s", configValue)); } public String getType() { diff --git a/src/test/java/co/rsk/federate/signing/ECDSASignerFactoryTest.java b/src/test/java/co/rsk/federate/signing/ECDSASignerFactoryTest.java index 25711c75..23bace85 100644 --- a/src/test/java/co/rsk/federate/signing/ECDSASignerFactoryTest.java +++ b/src/test/java/co/rsk/federate/signing/ECDSASignerFactoryTest.java @@ -118,8 +118,8 @@ void buildFromConfigHSM() throws SignerException { @Test void buildFromConfigUnknown() throws SignerException { Config configMock = mockConfig("a-random-type"); + SignerConfig signerConfig = new SignerConfig("a-random-id", configMock); try { - SignerConfig signerConfig = new SignerConfig("a-random-id", configMock); factory.buildFromConfig(signerConfig); fail(); } catch (RuntimeException e) {