SignatureUtils { public static String sign(String metadata, String key) throws SecurityException { try { return sign(metadata.getBytes(), key); } catch (Exception e) { throw new SecurityException("Failed to generate HMAC : " + e.getMessage(), e); } }  static String sign(String metadata, String key); static String sign(Object[] parameters, String metadata, String key); static String sign(byte[] data, String key);  }
@Test void testEncryptObject() { String encrypt = SignatureUtils.sign(objects, "TestMethod#hello", key); String encryptNoParams = SignatureUtils.sign(null, "TestMethod#hello", key); Assertions.assertNotNull(encrypt); Assertions.assertNotNull(encryptNoParams); Assertions.assertNotEquals(encrypt, encryptNoParams); }