@Test public void when_templates_are_proper_and_query_is_empty_then_simple_client_is_created(){ setSystemProperty(LdapClientProvider.LDAP_QUERY, ""); String template = "cn=${login}+sn=secret, ou=users, dc=example, dc=com"; helper.setPatterns(template); provider = new LdapClientProvider(); assertThat(provider.getClient()).isNotNull().isInstanceOf(SimpleLdapClient.class); }
public LdapClient getClient(){ if(ldapClient == null){ throw new IllegalStateException("LDAP is not properly configured. Maybe you forgot to put LDAP properties inside cloudstore.properties?"); } return ldapClient; }
LdapClientProvider { public LdapClient getClient(){ if(ldapClient == null){ throw new IllegalStateException("LDAP is not properly configured. Maybe you forgot to put LDAP properties inside cloudstore.properties?"); } return ldapClient; } }
LdapClientProvider { public LdapClient getClient(){ if(ldapClient == null){ throw new IllegalStateException("LDAP is not properly configured. Maybe you forgot to put LDAP properties inside cloudstore.properties?"); } return ldapClient; } protected  LdapClientProvider(); protected  LdapClientProvider(OneTimePadRegistry adminPasswordRegistry); }
LdapClientProvider { public LdapClient getClient(){ if(ldapClient == null){ throw new IllegalStateException("LDAP is not properly configured. Maybe you forgot to put LDAP properties inside cloudstore.properties?"); } return ldapClient; } protected  LdapClientProvider(); protected  LdapClientProvider(OneTimePadRegistry adminPasswordRegistry); LdapClient getClient(); static LdapClientProvider getInstance(); }
LdapClientProvider { public LdapClient getClient(){ if(ldapClient == null){ throw new IllegalStateException("LDAP is not properly configured. Maybe you forgot to put LDAP properties inside cloudstore.properties?"); } return ldapClient; } protected  LdapClientProvider(); protected  LdapClientProvider(OneTimePadRegistry adminPasswordRegistry); LdapClient getClient(); static LdapClientProvider getInstance(); static final String LDAP_TEMPLATE_PATTERN; static final String LDAP_URL; static final String LDAP_QUERY; static final String LDAP_ADMIN_DN; static final String LDAP_QUERY_DN; }