@Test void createSignature_test_with_null() { Throwable t = assertThrows(IllegalArgumentException.class, () -> SignatureUtil.createSignature(null) ); assertThat(t).hasMessage("algorithm is required; it must not be null"); }
public static Signature createSignature(String algorithm) { AssertUtil.notNull(algorithm, "algorithm is required; it must not be null"); try { return Signature.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } }
SignatureUtil { public static Signature createSignature(String algorithm) { AssertUtil.notNull(algorithm, "algorithm is required; it must not be null"); try { return Signature.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } } }
SignatureUtil { public static Signature createSignature(String algorithm) { AssertUtil.notNull(algorithm, "algorithm is required; it must not be null"); try { return Signature.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } } private  SignatureUtil(); }
SignatureUtil { public static Signature createSignature(String algorithm) { AssertUtil.notNull(algorithm, "algorithm is required; it must not be null"); try { return Signature.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } } private  SignatureUtil(); @Deprecated static Signature getRS256(); @Deprecated static Signature getES256(); static Signature createRS256(); static Signature createES256(); static Signature createSignature(String algorithm); }
SignatureUtil { public static Signature createSignature(String algorithm) { AssertUtil.notNull(algorithm, "algorithm is required; it must not be null"); try { return Signature.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } } private  SignatureUtil(); @Deprecated static Signature getRS256(); @Deprecated static Signature getES256(); static Signature createRS256(); static Signature createES256(); static Signature createSignature(String algorithm);  }