|
15 | 15 | */ |
16 | 16 | package org.labkey.test.tests; |
17 | 17 |
|
18 | | -import org.apache.hc.core5.http.HttpStatus; |
19 | 18 | import org.junit.Before; |
20 | 19 | import org.junit.Test; |
21 | 20 | import org.junit.experimental.categories.Category; |
22 | 21 | import org.labkey.remoteapi.CommandException; |
23 | | -import org.labkey.remoteapi.CommandResponse; |
24 | 22 | import org.labkey.remoteapi.Connection; |
25 | 23 | import org.labkey.remoteapi.SimplePostCommand; |
26 | 24 | import org.labkey.test.BaseWebDriverTest; |
@@ -99,6 +97,7 @@ public void editTermsAdminConsoleLinkTest() |
99 | 97 | protected void assureSiteWideTermsOfUsePage() |
100 | 98 | { |
101 | 99 | createTermsOfUsePage(null, SITE_WIDE_TERMS_TEXT); |
| 100 | + setFrequency(0); |
102 | 101 | } |
103 | 102 |
|
104 | 103 | // 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() |
245 | 244 | private final static int FREQUENCY_SECONDS = 10; |
246 | 245 |
|
247 | 246 | @Test |
248 | | - public void testRememberMeTerms() throws IOException, CommandException |
| 247 | + public void testRememberMeTerms() |
249 | 248 | { |
250 | 249 | log("Testing \"Require terms-of-use acceptance\" set to " + FREQUENCY_SECONDS + " seconds"); |
251 | 250 |
|
@@ -291,14 +290,20 @@ public void testRememberMeTerms() throws IOException, CommandException |
291 | 290 | setFrequency(0); |
292 | 291 | } |
293 | 292 |
|
294 | | - private void setFrequency(int frequency) throws IOException, CommandException |
| 293 | + private void setFrequency(int frequency) |
295 | 294 | { |
296 | 295 | // Use direct API call to set a value that may not appear in the drop-down list |
297 | 296 | Connection conn = createDefaultConnection(); |
298 | 297 | SimplePostCommand frequencyCommand = new SimplePostCommand("admin", "setTermsOfUseFrequency"); |
299 | 298 | 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 | + } |
302 | 307 | } |
303 | 308 |
|
304 | 309 | protected void signOutWithSiteWideTerms(String termsText, boolean acceptTerms) |
|
0 commit comments