Merge pull request #3686 from vramik/KEYCLOAK-3830
KEYCLOAK-3830 added missing test
This commit is contained in:
commit
6c8ebdb456
3 changed files with 32 additions and 0 deletions
|
@ -17,6 +17,12 @@
|
||||||
<role-name>user_premium</role-name>
|
<role-name>user_premium</role-name>
|
||||||
</auth-constraint>
|
</auth-constraint>
|
||||||
</security-constraint>
|
</security-constraint>
|
||||||
|
<security-constraint>
|
||||||
|
<web-resource-collection>
|
||||||
|
<web-resource-name>Public Resource</web-resource-name>
|
||||||
|
<url-pattern>/public-html.html</url-pattern>
|
||||||
|
</web-resource-collection>
|
||||||
|
</security-constraint>
|
||||||
|
|
||||||
<login-config>
|
<login-config>
|
||||||
<auth-method>KEYCLOAK</auth-method>
|
<auth-method>KEYCLOAK</auth-method>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Public resource</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>This is public resource that should be accessible without login.</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -268,6 +268,21 @@ public abstract class AbstractServletAuthzAdapterTest extends AbstractExampleAda
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//KEYCLOAK-3830
|
||||||
|
@Test
|
||||||
|
public void testAccessPublicResource() throws Exception {
|
||||||
|
try {
|
||||||
|
this.deployer.deploy(RESOURCE_SERVER_ID);
|
||||||
|
|
||||||
|
driver.navigate().to(getResourceServerUrl() + "/public-html.html");
|
||||||
|
WaitUtils.waitForPageToLoad(driver);
|
||||||
|
assertTrue(hasText("This is public resource that should be accessible without login."));
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
this.deployer.undeploy(RESOURCE_SERVER_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean hasLink(String text) {
|
private boolean hasLink(String text) {
|
||||||
return getLink(text) != null;
|
return getLink(text) != null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue