@Test
public void testToHmacAlgo() throws Exception {

  assertEquals("HmacSha1", StreamingAeadUtil.toHmacAlgo(HashType.SHA1));
  assertEquals("HmacSha256", StreamingAeadUtil.toHmacAlgo(HashType.SHA256));
  assertEquals("HmacSha512", StreamingAeadUtil.toHmacAlgo(HashType.SHA512));
  try {
    StreamingAeadUtil.toHmacAlgo(HashType.UNKNOWN_HASH);
    fail("should throw NoSuchAlgorithmException");
  } catch (NoSuchAlgorithmException ex) {
    assertExceptionContains(ex, "hash unsupported for HMAC");
  }
}