@Test
void shouldThrowOnOutOfAllowedSizeType() {

  ByteBuf testSecurityPayload = ByteBufAllocator.DEFAULT.buffer();
  // 130 chars
  String customAuthType =
      "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
  Assertions.assertThatThrownBy(
          () ->
              AuthMetadataCodec.encodeMetadata(
                  ByteBufAllocator.DEFAULT, customAuthType, testSecurityPayload))
      .hasMessage(
          "custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");
}