public static String sign(String data, String key) throws Exception {
        try {
            byte[] signature = sign(data.getBytes(UTF8), key.getBytes(UTF8), SignUtil.SigningAlgorithm.HmacSHA1);
            return new String(Base64.encodeBase64(signature));
        } catch (Exception ex) {
            throw new Exception("Unable to calculate a request signature: " + ex.getMessage(), ex);
        }
    }
@Test
    void testSignWithException2() throws Exception {
        assertThrows(Exception.class, () -> {
            SignUtil.sign("aaa".getBytes(StandardCharsets.UTF_8), "b".getBytes(StandardCharsets.UTF_8), null);
        });
    }