LdapIntegrationTest test case fail

Hi, I’ve got a problem with LdapIntegrationTest. After upgrading to flowable 6.2.0-SNAPSHOT, I run test cases of LdapIntegrationTest within the module of flowable-ldap-configurator. However, tests failed with error. The log says:

[main] ERROR org.springframework.test.context.TestContextManager  - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@17e8c1ec] to prepare test instance [testCandidateGroupFetchedThroughLdap(org.flowable.test.ldap.LdapIntegrationTest)]
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
	...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
	... 
Caused by: java.lang.NullPointerException
	at org.flowable.ldap.LDAPConfigurator.configure(LDAPConfigurator.java:58)
	at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.configuratorsAfterInit(ProcessEngineConfigurationImpl.java:1431)
	... 

Following is the method LDAPConfigurator.configure() :

@Override
public void configure(ProcessEngineConfigurationImpl processEngineConfiguration) {
    
    if (ldapConfiguration == null) {
        throw new FlowableException("ldapConfiguration is not set");
    }

    LDAPGroupCache ldapGroupCache = null;
    if (ldapConfiguration.getGroupCacheSize() > 0) {
        ldapGroupCache = new LDAPGroupCache(ldapConfiguration.getGroupCacheSize(), 
                ldapConfiguration.getGroupCacheExpirationTime(), processEngineConfiguration.getClock());
        
        if (ldapConfiguration.getGroupCacheListener() != null) {
            ldapGroupCache.setLdapCacheListener(ldapConfiguration.getGroupCacheListener());
        }
    }

    EngineServiceUtil.getIdmEngineConfiguration(processEngineConfiguration)
            .setIdmIdentityService(new LDAPIdentityServiceImpl(ldapConfiguration, ldapGroupCache));
}

In fact, EngineServiceUtil.getIdmEngineConfiguration tries to fetch the EngineConfiguration with the key of “cfg.idmEngine”. But there is no such EngineConfiguration. Therefore, getIdmEngineConfiguration returns null.
Well, how can I run the tests successfully?
Environment: JDK 7, Eclipse Mars.2
Many thanks.

Indeed, you’ve hit a bug. See https://github.com/flowable/flowable-engine/pull/497 for the fix.

To workaround the bug using 6.1.2, you can set the configurator directly in the ‘configurators’ property instead of using the ‘idmProcessEngineConfigurator’.

Yes, I updated the source. The unit test passes now. Thanks a lot.