Skip to content

Commit

Permalink
fix ldautility test
Browse files Browse the repository at this point in the history
  • Loading branch information
006627 committed Jun 26, 2024
1 parent 928058f commit a57619e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
RODA_CORE_SOLR_TYPE: CLOUD
RODA_CORE_SOLR_CLOUD_URLS: localhost:2181
SIEGFRIED_MODE: standalone
LDAP_SERVER_URL: ldap://localhost
LDAP_SERVER_PORT: 1389
- name: Package
run:
mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true package
Expand All @@ -90,3 +92,5 @@ jobs:
RODA_CORE_SOLR_TYPE: CLOUD
RODA_CORE_SOLR_CLOUD_URLS: localhost:2181
SIEGFRIED_MODE: standalone
LDAP_SERVER_URL: ldap://localhost
LDAP_SERVER_PORT: 1389
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,4 @@ public void testGetConfigurationFile() throws IOException {
configurationFilePath.toString());
}

@Test
public void testGetConfigurationFileAsStream() throws IOException {
// set up
Path configPath = configurationManager.getConfigPath();
Files.createDirectories(configPath);
String configurationFile = "roda-wui.properties";
Path configurationFilePath = Files.createFile(configPath.resolve(configurationFile));

// check if input stream is not null
InputStream configurationFileAsStream = configurationManager
.getConfigurationFileAsStream(configurationFilePath.toString());
Assert.assertNotNull(configurationFileAsStream);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ public void initialize(RodaConstants.NodeType nodeType) throws Exception {
this.rodaAdministratorsDN = configuration.getString("core.ldap.rodaAdministratorsDN",
"cn=administrators,ou=groups,dc=roda,dc=org");

final String ldapUrl = configuration.getString("core.ldap.url", RodaConstants.CORE_LDAP_DEFAULT_URL);
final int ldapPort = configuration.getInt("core.ldap.port", RodaConstants.CORE_LDAP_DEFAULT_PORT);
final String ldapAdminPassword = configuration.getString("core.ldap.adminPassword", "roda");

if (nodeType != RodaConstants.NodeType.TEST) {
final String ldapUrl = configuration.getString("core.ldap.url", RodaConstants.CORE_LDAP_DEFAULT_URL);
final int ldapPort = configuration.getInt("core.ldap.port", RodaConstants.CORE_LDAP_DEFAULT_PORT);
final String ldapAdminPassword = configuration.getString("core.ldap.adminPassword", "roda");

LdapContextSource contextSource = new LdapContextSource();
contextSource.setUrl(ldapUrl + ":" + ldapPort);
contextSource.setBase(ldapRootDN);
Expand Down

0 comments on commit a57619e

Please sign in to comment.