public InternalComponentPropertyDto setKey(String key) {
    checkArgument(key != null && !key.isEmpty(), "key can't be null nor empty");
    checkArgument(key.length() <= MAX_KEY_LENGTH, "key length (%s) is longer than the maximum authorized (%s). '%s' was provided", key.length(), MAX_KEY_LENGTH, key);
    this.key = key;
    return this;
  }
@Test
  void setKey_throws_IAE_if_key_is_too_long() {
    String veryLongKey = StringUtils.repeat("a", 513);

    assertThatThrownBy(() -> new InternalComponentPropertyDto().setKey(veryLongKey))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage(String.format("key length (513) is longer than the maximum authorized (512). '%s' was provided", veryLongKey));
  }