KEYCLOAK-3830 added missing test
This commit is contained in:
parent
2ba21485f9
commit
7f9e6bbf60
3 changed files with 32 additions and 0 deletions
|
@ -17,6 +17,12 @@
|
|||
<role-name>user_premium</role-name>
|
||||
</auth-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>
|
||||
<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>
|
|
@ -267,6 +267,21 @@ public abstract class AbstractServletAuthzAdapterTest extends AbstractExampleAda
|
|||
this.deployer.undeploy(RESOURCE_SERVER_ID);
|
||||
}
|
||||
}
|
||||
|
||||
//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) {
|
||||
return getLink(text) != null;
|
||||
|
|
Loading…
Reference in a new issue