Skip to content

Commit

Permalink
More HR properties parsing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed Nov 10, 2020
1 parent 850f9e3 commit 5fa1ad5
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.glite.security.voms.admin.integration.cern.HrDbError;
Expand Down Expand Up @@ -73,7 +77,24 @@ public void testValueParsing() {


@Test
public void testFileParsing() {
public void testFileParsing() throws FileNotFoundException, IOException {

Properties props = new Properties();
props
.load(new FileInputStream(new File("src/test/resources/cern/enabled-task/hr.properties")));

HrDbProperties hrDbProps = HrDbProperties.fromProperties(props);

assertThat(hrDbProps.getExperimentName(), is("cms"));
assertThat(hrDbProps.getMembershipCheck().isEnabled(), is(true));
assertThat(hrDbProps.getMembershipCheck().getStartHour(), is(4));
assertThat(hrDbProps.getMembershipCheck().isRunAtStartup(), is(false));
assertThat(hrDbProps.getApi().getEndpoint(), is("http://localhost:8080"));
assertThat(hrDbProps.getApi().getUsername(), is("user"));
assertThat(hrDbProps.getApi().getPassword(), is("password"));
assertThat(hrDbProps.getApi().getTimeoutInSeconds(), is(2L));



}

Expand Down

0 comments on commit 5fa1ad5

Please sign in to comment.