@Test
void customMimeHeaderLength129_encodingFails() {

  StringBuilder builder = new StringBuilder(129);
  for (int i = 0; i < 129; i++) {
    builder.append('a');
  }
  assertThatIllegalArgumentException()
      .isThrownBy(
          () ->
              CompositeMetadataCodec.encodeMetadataHeader(
                  ByteBufAllocator.DEFAULT, builder.toString(), 0))
      .withMessage(
          "custom mime type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");
}