@Test
public void testHmacSha256HalfDigestTemplate() throws Exception {

  KeyTemplate template = HmacKeyManager.hmacSha256HalfDigestTemplate();
  assertThat(template.getTypeUrl()).isEqualTo(new HmacKeyManager().getKeyType());
  assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.TINK);
  HmacKeyFormat format =
      HmacKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry());
  assertThat(format.getKeySize()).isEqualTo(32);
  assertThat(format.getParams().getTagSize()).isEqualTo(16);
  assertThat(format.getParams().getHash()).isEqualTo(HashType.SHA256);
}