public static void validateSourceConfig(SourceConfig sourceConfig, ValidatableFunctionPackage sourceFunction) {
        try {
            ConnectorDefinition defn = sourceFunction.getFunctionMetaData(ConnectorDefinition.class);
            if (defn != null && defn.getSourceConfigClass() != null) {
                Class configClass =
                        Class.forName(defn.getSourceConfigClass(), true, sourceFunction.getClassLoader());
                validateSourceConfig(sourceConfig, configClass);
            }
        } catch (ClassNotFoundException e) {
            throw new IllegalArgumentException("Could not find source config class");
        }

    }
@Test
    public void testValidateConfig() {
        SourceConfig sourceConfig = createSourceConfig();

        // Good config
        sourceConfig.getConfigs().put("configParameter", "Test");
        SourceConfigUtils.validateSourceConfig(sourceConfig, SourceConfigUtilsTest.TestSourceConfig.class);

        // Bad config
        sourceConfig.getConfigs().put("configParameter", null);
        Exception e = expectThrows(IllegalArgumentException.class,
                () -> SourceConfigUtils.validateSourceConfig(sourceConfig, SourceConfigUtilsTest.TestSourceConfig.class));
        assertTrue(e.getMessage().contains("Could not validate source config: Field 'configParameter' cannot be null!"));
    }