private static void validateAwsCredentialProviderClass()

in src/main/java/software/amazon/event/kafkaconnector/EventBridgeSinkConfigValidator.java [151:175]


  private static void validateAwsCredentialProviderClass(ConfigValue configValue) {
    var requiredInterface = AwsCredentialsProvider.class;
    var className = (String) configValue.value();
    if (StringUtils.isNotBlank(className)) {
      try {
        var clazz = Class.forName((String) configValue.value());
        if (!requiredInterface.isAssignableFrom(clazz)) {
          throw new ConfigException(
              "Class '"
                  + className
                  + "' does not implement '"
                  + requiredInterface.getCanonicalName()
                  + "'.");
        }
        clazz.getDeclaredConstructor();
      } catch (ClassNotFoundException e) {
        throw new ConfigException(
            "Class '"
                + className
                + "' can't be loaded. Ensure the class path you have specified is correct.");
      } catch (NoSuchMethodException e) {
        throw new ConfigException("Class '" + className + "' requires a no-arg constructor.");
      }
    }
  }