public static String checkComponentName(String name) {
    checkArgument(!isNullOrEmpty(name), "Component name can't be empty");
    checkArgument(name.length() <= MAX_COMPONENT_NAME_LENGTH, "Component name length (%s) is longer than the maximum authorized (%s). '%s' was provided.",
      name.length(), MAX_COMPONENT_NAME_LENGTH, name);
    return name;
  }
@Test
  void fail_when_name_longer_than_500_characters() {
    assertThatThrownBy(() -> ComponentValidator.checkComponentName(repeat("a", 500 + 1)))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessageContaining("Component name length");
  }