@Test public void testTestConnectionWithLdapConfig() { LdapConfig ldapConfig = new LdapConfig(); String actualResult = underTest.testConnection(null, ldapConfig); assertEquals("connected", actualResult); }
public String testConnection(String environmentCrn, LdapConfig ldapConfig) { if (environmentCrn == null && ldapConfig == null) { throw new BadRequestException("Either an environment or an LDAP 'validationRequest' needs to be specified in the request. "); } try { if (environmentCrn != null) { ldapConfig = get(environmentCrn); } ldapConfigValidator.validateLdapConnection(ldapConfig); return "connected"; } catch (BadRequestException e) { return e.getMessage(); } }
LdapConfigService extends AbstractArchivistService<LdapConfig> { public String testConnection(String environmentCrn, LdapConfig ldapConfig) { if (environmentCrn == null && ldapConfig == null) { throw new BadRequestException("Either an environment or an LDAP 'validationRequest' needs to be specified in the request. "); } try { if (environmentCrn != null) { ldapConfig = get(environmentCrn); } ldapConfigValidator.validateLdapConnection(ldapConfig); return "connected"; } catch (BadRequestException e) { return e.getMessage(); } } }
LdapConfigService extends AbstractArchivistService<LdapConfig> { public String testConnection(String environmentCrn, LdapConfig ldapConfig) { if (environmentCrn == null && ldapConfig == null) { throw new BadRequestException("Either an environment or an LDAP 'validationRequest' needs to be specified in the request. "); } try { if (environmentCrn != null) { ldapConfig = get(environmentCrn); } ldapConfigValidator.validateLdapConnection(ldapConfig); return "connected"; } catch (BadRequestException e) { return e.getMessage(); } }  }
LdapConfigService extends AbstractArchivistService<LdapConfig> { public String testConnection(String environmentCrn, LdapConfig ldapConfig) { if (environmentCrn == null && ldapConfig == null) { throw new BadRequestException("Either an environment or an LDAP 'validationRequest' needs to be specified in the request. "); } try { if (environmentCrn != null) { ldapConfig = get(environmentCrn); } ldapConfigValidator.validateLdapConnection(ldapConfig); return "connected"; } catch (BadRequestException e) { return e.getMessage(); } }  LdapConfig createLdapConfig(LdapConfig ldapConfig); LdapConfig createLdapConfig(LdapConfig ldapConfig, String accountId); LdapConfig get(String environmentCrn); List<LdapConfig> findAllByEnvironmentAndAccountIdEvenIfArchived(String environmentCrn, String accountId); Optional<LdapConfig> find(String environmentCrn, String accountId, String clusterName); void delete(String environmentCrn); void delete(String environmentCrn, String accountId); void delete(String environmentCrn, String accountId, String clusterName); void deleteAllInEnvironment(String environmentCrn, String accountId); String testConnection(String environmentCrn, LdapConfig ldapConfig); @Override JpaRepository repository(); }
LdapConfigService extends AbstractArchivistService<LdapConfig> { public String testConnection(String environmentCrn, LdapConfig ldapConfig) { if (environmentCrn == null && ldapConfig == null) { throw new BadRequestException("Either an environment or an LDAP 'validationRequest' needs to be specified in the request. "); } try { if (environmentCrn != null) { ldapConfig = get(environmentCrn); } ldapConfigValidator.validateLdapConnection(ldapConfig); return "connected"; } catch (BadRequestException e) { return e.getMessage(); } }  LdapConfig createLdapConfig(LdapConfig ldapConfig); LdapConfig createLdapConfig(LdapConfig ldapConfig, String accountId); LdapConfig get(String environmentCrn); List<LdapConfig> findAllByEnvironmentAndAccountIdEvenIfArchived(String environmentCrn, String accountId); Optional<LdapConfig> find(String environmentCrn, String accountId, String clusterName); void delete(String environmentCrn); void delete(String environmentCrn, String accountId); void delete(String environmentCrn, String accountId, String clusterName); void deleteAllInEnvironment(String environmentCrn, String accountId); String testConnection(String environmentCrn, LdapConfig ldapConfig); @Override JpaRepository repository();  }