Skip to content

Commit 069c3b3

Browse files
committed
Feedback
1 parent 5e9f584 commit 069c3b3

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/org/labkey/test/tests/SiteWideTermsOfUseTest.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
*/
1616
package org.labkey.test.tests;
1717

18-
import org.apache.hc.core5.http.HttpStatus;
1918
import org.junit.Before;
2019
import org.junit.Test;
2120
import org.junit.experimental.categories.Category;
2221
import org.labkey.remoteapi.CommandException;
23-
import org.labkey.remoteapi.CommandResponse;
2422
import org.labkey.remoteapi.Connection;
2523
import org.labkey.remoteapi.SimplePostCommand;
2624
import org.labkey.test.BaseWebDriverTest;
@@ -99,6 +97,7 @@ public void editTermsAdminConsoleLinkTest()
9997
protected void assureSiteWideTermsOfUsePage()
10098
{
10199
createTermsOfUsePage(null, SITE_WIDE_TERMS_TEXT);
100+
setFrequency(0);
102101
}
103102

104103
// Test that the site-wide terms appear when you log out, even if you've accepted the terms when logged in
@@ -245,7 +244,7 @@ public void testFailedLoginBadPassword()
245244
private final static int FREQUENCY_SECONDS = 10;
246245

247246
@Test
248-
public void testRememberMeTerms() throws IOException, CommandException
247+
public void testRememberMeTerms()
249248
{
250249
log("Testing \"Require terms-of-use acceptance\" set to " + FREQUENCY_SECONDS + " seconds");
251250

@@ -291,14 +290,20 @@ public void testRememberMeTerms() throws IOException, CommandException
291290
setFrequency(0);
292291
}
293292

294-
private void setFrequency(int frequency) throws IOException, CommandException
293+
private void setFrequency(int frequency)
295294
{
296295
// Use direct API call to set a value that may not appear in the drop-down list
297296
Connection conn = createDefaultConnection();
298297
SimplePostCommand frequencyCommand = new SimplePostCommand("admin", "setTermsOfUseFrequency");
299298
frequencyCommand.setParameters(Map.of("seconds", frequency));
300-
CommandResponse response = frequencyCommand.execute(conn, "/");
301-
assertEquals(HttpStatus.SC_OK, response.getStatusCode());
299+
try
300+
{
301+
frequencyCommand.execute(conn, "/");
302+
}
303+
catch (IOException | CommandException e)
304+
{
305+
throw new RuntimeException(e);
306+
}
302307
}
303308

304309
protected void signOutWithSiteWideTerms(String termsText, boolean acceptTerms)

0 commit comments

Comments
 (0)