test_class.file: java_src/src/test/java/com/google/crypto/tink/streamingaead/StreamingAeadUtilTest.java
test_class.identifier: StreamingAeadUtilTest
test_case.body: @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");
      }
    }
test_case.class_method_signature: StreamingAeadUtilTest.testToHmacAlgo()
test_case.full_signature: @Test public void testToHmacAlgo()
test_case.identifier: testToHmacAlgo
test_case.invocations: assertEquals toHmacAlgo assertEquals toHmacAlgo assertEquals toHmacAlgo toHmacAlgo fail assertExceptionContains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testToHmacAlgo()
focal_class.file: java_src/src/main/java/com/google/crypto/tink/streamingaead/StreamingAeadUtil.java
focal_class.identifier: StreamingAeadUtil
focal_class.class_method_signature: StreamingAeadUtil.toHmacAlgo(HashType hash)
focal_class.full_signature: public static String toHmacAlgo(HashType hash)
focal_class.identifier: toHmacAlgo
focal_class.modifiers: public static
focal_class.parameters: (HashType hash)
focal_class.return: String
focal_class.signature: String toHmacAlgo(HashType hash)
focal_method.body: public static String toHmacAlgo(HashType hash) throws NoSuchAlgorithmException {
      switch (hash) {
        case SHA1:
          return "HmacSha1";
        case SHA256:
          return "HmacSha256";
        case SHA512:
          return "HmacSha512";
        default:
          throw new NoSuchAlgorithmException("hash unsupported for HMAC: " + hash);
      }
    }
focal_method.class_method_signature: StreamingAeadUtil.toHmacAlgo(HashType hash)
focal_method.full_signature: public static String toHmacAlgo(HashType hash)
focal_method.identifier: toHmacAlgo
focal_method.modifiers: public static
focal_method.parameters: (HashType hash)
focal_method.return: String
focal_method.signature: String toHmacAlgo(HashType hash)