|
24 | 24 | import org.junit.BeforeClass; |
25 | 25 | import org.junit.Test; |
26 | 26 | import org.junit.runner.RunWith; |
| 27 | +import org.openqa.selenium.NoSuchElementException; |
27 | 28 | import org.openqa.selenium.WebDriver; |
28 | 29 | import org.wildfly.extras.creaper.core.CommandFailedException; |
29 | 30 | import org.wildfly.extras.creaper.core.online.ModelNodeResult; |
|
33 | 34 | import org.wildfly.extras.creaper.core.online.operations.Operations; |
34 | 35 | import org.wildfly.extras.creaper.core.online.operations.Values; |
35 | 36 |
|
| 37 | +import static org.junit.Assume.assumeNoException; |
| 38 | +import static org.junit.Assume.assumeTrue; |
| 39 | + |
36 | 40 | @RunWith(Arquillian.class) |
37 | 41 | public class HTTPSListenerConfigurationTest { |
38 | 42 |
|
@@ -360,12 +364,16 @@ public void editRequestParseTimeout() throws Exception { |
360 | 364 |
|
361 | 365 | @Test |
362 | 366 | public void toggleRequireHostHttp11() throws Exception { |
363 | | - boolean requireHostHttp11 = operations.readAttribute( |
364 | | - HTTPS_LISTENER_ADDRESS, |
365 | | - "require-host-http11").booleanValue(); |
366 | | - crudOperations.update( |
367 | | - HTTPS_LISTENER_ADDRESS, |
368 | | - page.getHttpsListenerForm(), "require-host-http11", !requireHostHttp11); |
| 367 | + ModelNodeResult result = operations.readAttribute(HTTPS_LISTENER_ADDRESS, "require-host-http11"); |
| 368 | + assumeTrue(result.isDefined()); // if the attribute is not available in this configuration, skip the test |
| 369 | + boolean requireHostHttp11 = result.booleanValue(); |
| 370 | + try { |
| 371 | + crudOperations.update( |
| 372 | + HTTPS_LISTENER_ADDRESS, |
| 373 | + page.getHttpsListenerForm(), "require-host-http11", !requireHostHttp11); |
| 374 | + } catch (NoSuchElementException e) { |
| 375 | + assumeNoException(e); // the UI element is not available in this configuration, skip the test |
| 376 | + } |
369 | 377 | } |
370 | 378 |
|
371 | 379 | @Test |
|
0 commit comments