@Test
public void test_wrapNoRaw_throws() throws Exception {

  PrimitiveSet<JwtMac> primitiveSet = PrimitiveSet.newPrimitiveSet(JwtMac.class);
  primitiveSet.addPrimitive(
      new JwtHmac("HS256", new SecretKeySpec(Random.randBytes(32), "HMAC")),
      Keyset.Key.newBuilder()
          .setKeyId(202020)
          .setStatus(KeyStatusType.ENABLED)
          .setOutputPrefixType(OutputPrefixType.TINK)
          .build());
  PrimitiveSet.Entry<JwtMac> entry =
      primitiveSet.addPrimitive(
          new JwtHmac("HS256", new SecretKeySpec(Random.randBytes(32), "HMAC")),
          Keyset.Key.newBuilder()
              .setKeyId(202021)
              .setStatus(KeyStatusType.ENABLED)
              .setOutputPrefixType(OutputPrefixType.RAW)
              .build());
  primitiveSet.setPrimary(entry);
  try {
    wrapper.wrap(primitiveSet);
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}