KEYCLOAK-4393 Remove example tests
This commit is contained in:
parent
efd44d86c5
commit
0c21b8c3a6
41 changed files with 0 additions and 1482 deletions
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
|
||||
import javax.ws.rs.core.UriBuilder;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class BasicAuthExample extends AbstractPageWithInjectedUrl {
|
||||
|
||||
public static final String DEPLOYMENT_NAME = "basic-auth-example";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("basicauth");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UriBuilder createUriBuilder() {
|
||||
return super.createUriBuilder()
|
||||
.userInfo("{user}:{password}")
|
||||
.path("service/echo")
|
||||
.queryParam("value", "{value}");
|
||||
}
|
||||
|
||||
public BasicAuthExample setTemplateValues(String user, String password, String value) {
|
||||
setUriParameter("user", user);
|
||||
setUriParameter("password", password);
|
||||
setUriParameter("value", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.graphene.findby.FindByJQuery;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class CustomerPortalExample extends AbstractPageWithInjectedUrl {
|
||||
|
||||
public static final String DEPLOYMENT_NAME = "customer-portal-example";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("customer-portal");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
@FindByJQuery("h1:contains('Customer Portal')")
|
||||
private WebElement title;
|
||||
|
||||
@FindByJQuery("a:contains('Customer Listing')")
|
||||
private WebElement customerListingLink;
|
||||
@FindByJQuery("h1:contains('Customer Listing')")
|
||||
private WebElement customerListingHeader;
|
||||
|
||||
@FindByJQuery("h1:contains('Customer Session')")
|
||||
private WebElement customerSessionHeader;
|
||||
|
||||
@FindByJQuery("a:contains('Customer Admin Interface')")
|
||||
private WebElement customerAdminInterfaceLink;
|
||||
|
||||
@FindByJQuery("a:contains('Customer Session')")
|
||||
private WebElement customerSessionLink;
|
||||
|
||||
@FindByJQuery("a:contains('products')")
|
||||
private WebElement productsLink;
|
||||
|
||||
@FindByJQuery("a:contains('logout')")
|
||||
private WebElement logOutButton;
|
||||
|
||||
public void goToProducts() {
|
||||
productsLink.click();
|
||||
}
|
||||
|
||||
public void customerListing() {
|
||||
customerListingLink.click();
|
||||
}
|
||||
|
||||
public void customerAdminInterface() {
|
||||
customerAdminInterfaceLink.click();
|
||||
}
|
||||
|
||||
public void customerSession() {
|
||||
waitUntilElement(customerSessionLink).is().present();
|
||||
customerSessionLink.click();
|
||||
}
|
||||
|
||||
public void logOut() {
|
||||
logOutButton.click();
|
||||
}
|
||||
|
||||
public void waitForCustomerListingHeader() {
|
||||
waitUntilElement(customerListingHeader).is().not().present();
|
||||
}
|
||||
|
||||
public void waitForCustomerSessionHeader() {
|
||||
waitUntilElement(customerSessionHeader).is().not().present();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class DatabaseServiceExample extends AbstractPageWithInjectedUrl {
|
||||
|
||||
public static final String DEPLOYMENT_NAME = "database-service-example";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("database");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
|
||||
import javax.ws.rs.core.UriBuilder;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class MultiTenantExample extends AbstractPageWithInjectedUrl {
|
||||
|
||||
public static final String DEPLOYMENT_NAME = "multi-tenant-example";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UriBuilder createUriBuilder() {
|
||||
return super.createUriBuilder().path("{tenantRealm}");
|
||||
}
|
||||
|
||||
public URL getTenantRealmUrl(String realm) {
|
||||
try {
|
||||
return getUriBuilder().build(realm).toURL();
|
||||
} catch (MalformedURLException ex) {
|
||||
throw new IllegalStateException("Page URL is malformed.");
|
||||
}
|
||||
}
|
||||
|
||||
public void navigateToRealm(String realm) {
|
||||
URL u = getTenantRealmUrl(realm);
|
||||
log.info("navigate to "+u.toExternalForm());
|
||||
driver.navigate().to(u.toExternalForm());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.graphene.findby.FindByJQuery;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class ProductPortalExample extends AbstractPageWithInjectedUrl {
|
||||
|
||||
public static final String DEPLOYMENT_NAME = "product-portal-example";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("product-portal");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
@FindByJQuery("h1:contains('Product Portal')")
|
||||
private WebElement title;
|
||||
|
||||
@FindByJQuery("a:contains('Product Listing')")
|
||||
private WebElement productListingLink;
|
||||
@FindByJQuery("h1:contains('Product Listing')")
|
||||
private WebElement productListingHeader;
|
||||
|
||||
@FindByJQuery("a:contains('customers')")
|
||||
private WebElement customersLink;
|
||||
|
||||
@FindByJQuery("a:contains('logout')")
|
||||
private WebElement logOutButton;
|
||||
|
||||
public void productListing() {
|
||||
productListingLink.click();
|
||||
}
|
||||
|
||||
public void goToCustomers() {
|
||||
customersLink.click();
|
||||
}
|
||||
|
||||
public void waitForProductListingHeader() {
|
||||
waitUntilElement(productListingHeader).is().not().present();
|
||||
}
|
||||
|
||||
public void logOut() {
|
||||
logOutButton.click();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
public class SAMLPostEncExample extends AbstractPageWithInjectedUrl {
|
||||
public static final String DEPLOYMENT_NAME = "saml-post-encryption";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@FindBy(tagName = "a")
|
||||
WebElement logoutButton;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("sales-post-enc");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
public void logout() {
|
||||
logoutButton.click();
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
public class SAMLPostSigExample extends AbstractPageWithInjectedUrl {
|
||||
public static final String DEPLOYMENT_NAME = "sales-post-sig";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@FindBy(tagName = "a")
|
||||
WebElement logoutButton;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("sales-post-sig");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
public void logout() {
|
||||
logoutButton.click();
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.page;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
public class SAMLRedirectSigExample extends AbstractPageWithInjectedUrl {
|
||||
public static final String DEPLOYMENT_NAME = "saml-redirect-signatures";
|
||||
|
||||
@ArquillianResource
|
||||
@OperateOnDeployment(DEPLOYMENT_NAME)
|
||||
private URL url;
|
||||
|
||||
@FindBy(tagName = "a")
|
||||
WebElement logoutButton;
|
||||
|
||||
@Override
|
||||
public URL getInjectedUrl() {
|
||||
//EAP6 URL fix
|
||||
URL fixedUrl = createInjectedURL("employee-sig");
|
||||
return fixedUrl != null ? fixedUrl : url;
|
||||
}
|
||||
|
||||
public void logout() {
|
||||
logoutButton.click();
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.graphene.page.Page;
|
||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
|
||||
import org.keycloak.testsuite.adapter.page.BasicAuthExample;
|
||||
|
||||
import javax.ws.rs.client.Client;
|
||||
import javax.ws.rs.client.ClientBuilder;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.keycloak.testsuite.auth.page.AuthRealm.EXAMPLE;
|
||||
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
|
||||
|
||||
public abstract class AbstractBasicAuthExampleAdapterTest extends AbstractExampleAdapterTest {
|
||||
|
||||
@Page
|
||||
private BasicAuthExample basicAuthExample;
|
||||
|
||||
@Deployment(name = BasicAuthExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive basicAuthExample() throws IOException {
|
||||
return exampleDeployment("examples-basicauth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
||||
testRealms.add(loadRealm(new File(EXAMPLES_HOME_DIR + "/basic-auth/basicauthrealm.json")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultPageUriParameters() {
|
||||
super.setDefaultPageUriParameters();
|
||||
testRealmPage.setAuthRealm(EXAMPLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicAuthExample() {
|
||||
String value = "hello";
|
||||
Client client = ClientBuilder.newClient();
|
||||
|
||||
Response response = client.target(basicAuthExample
|
||||
.setTemplateValues("admin", "password", value).buildUri()).request().get();
|
||||
assertEquals(200, response.getStatus());
|
||||
assertEquals(value, response.readEntity(String.class));
|
||||
response.close();
|
||||
|
||||
response = client.target(basicAuthExample
|
||||
.setTemplateValues("invalid-user", "password", value).buildUri()).request().get();
|
||||
assertEquals(401, response.getStatus());
|
||||
String readResponse = response.readEntity(String.class);
|
||||
assertTrue(readResponse.contains("Unauthorized") || readResponse.contains("Status 401"));
|
||||
response.close();
|
||||
|
||||
response = client.target(basicAuthExample
|
||||
.setTemplateValues("admin", "invalid-password", value).buildUri()).request().get();
|
||||
assertEquals(401, response.getStatus());
|
||||
readResponse = response.readEntity(String.class);
|
||||
assertTrue(readResponse.contains("Unauthorized") || readResponse.contains("Status 401"));
|
||||
response.close();
|
||||
|
||||
client.close();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,373 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.graphene.page.Page;
|
||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.admin.client.resource.ClientResource;
|
||||
import org.keycloak.representations.idm.ClientRepresentation;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
|
||||
import org.keycloak.testsuite.adapter.page.CustomerPortalExample;
|
||||
import org.keycloak.testsuite.adapter.page.DatabaseServiceExample;
|
||||
import org.keycloak.testsuite.adapter.page.ProductPortalExample;
|
||||
import org.keycloak.testsuite.admin.ApiUtil;
|
||||
import org.keycloak.testsuite.auth.page.account.Account;
|
||||
import org.keycloak.testsuite.auth.page.account.Applications;
|
||||
import org.keycloak.testsuite.auth.page.login.OAuthGrant;
|
||||
import org.keycloak.testsuite.console.page.events.Config;
|
||||
import org.keycloak.testsuite.console.page.events.LoginEvents;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
|
||||
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
|
||||
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
|
||||
|
||||
public abstract class AbstractDemoExampleAdapterTest extends AbstractExampleAdapterTest {
|
||||
|
||||
@Page
|
||||
private CustomerPortalExample customerPortalExamplePage;
|
||||
|
||||
@Page
|
||||
private ProductPortalExample productPortalExamplePage;
|
||||
|
||||
@Page
|
||||
private DatabaseServiceExample databaseServiceExamplePage;
|
||||
|
||||
@Page
|
||||
private Account testRealmAccountPage;
|
||||
|
||||
@Page
|
||||
private Config configPage;
|
||||
|
||||
@Page
|
||||
private LoginEvents loginEventsPage;
|
||||
|
||||
@Page
|
||||
private OAuthGrant oAuthGrantPage;
|
||||
|
||||
@Page
|
||||
private Applications applicationsPage;
|
||||
|
||||
@Deployment(name = CustomerPortalExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive customerPortalExample() throws IOException {
|
||||
return exampleDeployment(CustomerPortalExample.DEPLOYMENT_NAME);
|
||||
}
|
||||
|
||||
@Deployment(name = ProductPortalExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive productPortalExample() throws IOException {
|
||||
return exampleDeployment(ProductPortalExample.DEPLOYMENT_NAME);
|
||||
}
|
||||
|
||||
@Deployment(name = DatabaseServiceExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive databaseServiceExample() throws IOException {
|
||||
return exampleDeployment("database-service");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
||||
testRealms.add(
|
||||
loadRealm(new File(EXAMPLES_HOME_DIR + "/demo-template/testrealm.json")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultPageUriParameters() {
|
||||
super.setDefaultPageUriParameters();
|
||||
testRealmPage.setAuthRealm(DEMO);
|
||||
testRealmLoginPage.setAuthRealm(DEMO);
|
||||
testRealmAccountPage.setAuthRealm(DEMO);
|
||||
configPage.setConsoleRealm(DEMO);
|
||||
loginEventsPage.setConsoleRealm(DEMO);
|
||||
applicationsPage.setAuthRealm(DEMO);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void beforeDemoExampleTest() {
|
||||
customerPortalExamplePage.navigateTo();
|
||||
driver.manage().deleteAllCookies();
|
||||
productPortalExamplePage.navigateTo();
|
||||
driver.manage().deleteAllCookies();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void customerPortalListingTest() {
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerListing();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertCurrentUrlStartsWith(customerPortalExamplePage);
|
||||
customerPortalExamplePage.waitForCustomerListingHeader();
|
||||
|
||||
Assert.assertTrue(driver.getPageSource().contains("Username: bburke@redhat.com"));
|
||||
Assert.assertTrue(driver.getPageSource().contains("Bill Burke"));
|
||||
Assert.assertTrue(driver.getPageSource().contains("Stian Thorgersen"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void customerPortalSessionTest() {
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerSession();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertCurrentUrlStartsWith(customerPortalExamplePage);
|
||||
|
||||
customerPortalExamplePage.waitForCustomerSessionHeader();
|
||||
Assert.assertTrue(driver.getPageSource().contains("You visited this page"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void productPortalListingTest() {
|
||||
|
||||
productPortalExamplePage.navigateTo();
|
||||
productPortalExamplePage.productListing();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertCurrentUrlStartsWith(productPortalExamplePage);
|
||||
productPortalExamplePage.waitForProductListingHeader();
|
||||
|
||||
Assert.assertTrue(driver.getPageSource().contains("iphone"));
|
||||
Assert.assertTrue(driver.getPageSource().contains("ipad"));
|
||||
Assert.assertTrue(driver.getPageSource().contains("ipod"));
|
||||
|
||||
productPortalExamplePage.goToCustomers();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void goToProductPortalWithOneLoginTest() {
|
||||
|
||||
productPortalExamplePage.navigateTo();
|
||||
productPortalExamplePage.productListing();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertCurrentUrlStartsWith(productPortalExamplePage);
|
||||
productPortalExamplePage.waitForProductListingHeader();
|
||||
productPortalExamplePage.goToCustomers();
|
||||
|
||||
assertCurrentUrlStartsWith(customerPortalExamplePage);
|
||||
customerPortalExamplePage.customerListing();
|
||||
customerPortalExamplePage.goToProducts();
|
||||
assertCurrentUrlStartsWith(productPortalExamplePage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void logoutFromAllAppsTest() {
|
||||
|
||||
productPortalExamplePage.navigateTo();
|
||||
productPortalExamplePage.productListing();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertCurrentUrlStartsWith(productPortalExamplePage);
|
||||
productPortalExamplePage.waitForProductListingHeader();
|
||||
|
||||
if (isRelative()) { //KEYCLOAK-1546
|
||||
productPortalExamplePage.logOut();
|
||||
} else {
|
||||
driver.navigate().to(testRealmPage.getOIDCLogoutUrl() + "?redirect_uri=" + productPortalExamplePage);
|
||||
}
|
||||
|
||||
assertCurrentUrlStartsWith(productPortalExamplePage);
|
||||
productPortalExamplePage.productListing();
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerListing();
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
customerPortalExamplePage.logOut();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void grantServerBasedApp() {
|
||||
ClientResource clientResource = ApiUtil.findClientResourceByClientId(testRealmResource(), "customer-portal");
|
||||
ClientRepresentation client = clientResource.toRepresentation();
|
||||
client.setConsentRequired(true);
|
||||
clientResource.update(client);
|
||||
|
||||
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||
realm.setEventsEnabled(true);
|
||||
realm.setEnabledEventTypes(Arrays.asList("REVOKE_GRANT", "LOGIN"));
|
||||
testRealmResource().update(realm);
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerSession();
|
||||
|
||||
loginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
assertTrue(oAuthGrantPage.isCurrent());
|
||||
|
||||
oAuthGrantPage.accept();
|
||||
|
||||
assertTrue(driver.getPageSource().contains("Your hostname:"));
|
||||
assertTrue(driver.getPageSource().contains("You visited this page"));
|
||||
|
||||
applicationsPage.navigateTo();
|
||||
applicationsPage.revokeGrantForApplication("customer-portal");
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerSession();
|
||||
|
||||
assertTrue(oAuthGrantPage.isCurrent());
|
||||
|
||||
loginEventsPage.navigateTo();
|
||||
if (!testContext.isAdminLoggedIn()) {
|
||||
loginPage.form().login(adminUser);
|
||||
testContext.setAdminLoggedIn(true);
|
||||
}
|
||||
loginEventsPage.table().filter();
|
||||
loginEventsPage.table().filterForm().addEventType("REVOKE_GRANT");
|
||||
loginEventsPage.table().update();
|
||||
|
||||
List<WebElement> resultList = loginEventsPage.table().rows();
|
||||
|
||||
assertEquals(1, resultList.size());
|
||||
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='REVOKE_GRANT']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='Client']/../td[text()='account']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='IP Address']/../td[text()='127.0.0.1' or text()='0:0:0:0:0:0:0:1']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='revoked_client']/../td[text()='customer-portal']"));
|
||||
|
||||
loginEventsPage.table().reset();
|
||||
loginEventsPage.table().filterForm().addEventType("LOGIN");
|
||||
loginEventsPage.table().update();
|
||||
resultList = loginEventsPage.table().rows();
|
||||
|
||||
assertEquals(1, resultList.size());
|
||||
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='LOGIN']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='Client']/../td[text()='customer-portal']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='IP Address']/../td[text()='127.0.0.1' or text()='0:0:0:0:0:0:0:1']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='username']/../td[text()='bburke@redhat.com']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='consent']/../td[text()='consent_granted']"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void historyOfAccessResourceTest() throws IOException {
|
||||
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||
realm.setEventsEnabled(true);
|
||||
realm.setEnabledEventTypes(Arrays.asList("LOGIN", "LOGIN_ERROR", "LOGOUT", "CODE_TO_TOKEN"));
|
||||
testRealmResource().update(realm);
|
||||
|
||||
customerPortalExamplePage.navigateTo();
|
||||
customerPortalExamplePage.customerListing();
|
||||
|
||||
testRealmLoginPage.form().login("bburke@redhat.com", "password");
|
||||
|
||||
Assert.assertTrue(driver.getPageSource().contains("Username: bburke@redhat.com")
|
||||
&& driver.getPageSource().contains("Bill Burke")
|
||||
&& driver.getPageSource().contains("Stian Thorgersen")
|
||||
);
|
||||
|
||||
if (isRelative()) { //KEYCLOAK-1546
|
||||
productPortalExamplePage.logOut();
|
||||
} else {
|
||||
driver.navigate().to(testRealmPage.getOIDCLogoutUrl() + "?redirect_uri=" + productPortalExamplePage);
|
||||
}
|
||||
|
||||
loginEventsPage.navigateTo();
|
||||
|
||||
if (!testContext.isAdminLoggedIn()) {
|
||||
loginPage.form().login(adminUser);
|
||||
testContext.setAdminLoggedIn(true);
|
||||
}
|
||||
|
||||
loginEventsPage.table().filter();
|
||||
loginEventsPage.table().filterForm().addEventType("LOGOUT");
|
||||
loginEventsPage.table().update();
|
||||
|
||||
List<WebElement> resultList = loginEventsPage.table().rows();
|
||||
|
||||
assertEquals(1, resultList.size());
|
||||
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='LOGOUT']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='Client']/../td[text()='']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='IP Address']/../td[text()='127.0.0.1' or text()='0:0:0:0:0:0:0:1']"));
|
||||
|
||||
loginEventsPage.table().reset();
|
||||
loginEventsPage.table().filterForm().addEventType("LOGIN");
|
||||
loginEventsPage.table().update();
|
||||
resultList = loginEventsPage.table().rows();
|
||||
|
||||
assertEquals(1, resultList.size());
|
||||
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='LOGIN']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='Client']/../td[text()='customer-portal']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='IP Address']/../td[text()='127.0.0.1' or text()='0:0:0:0:0:0:0:1']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='username']/../td[text()='bburke@redhat.com']"));
|
||||
|
||||
loginEventsPage.table().reset();
|
||||
loginEventsPage.table().filterForm().addEventType("CODE_TO_TOKEN");
|
||||
loginEventsPage.table().update();
|
||||
resultList = loginEventsPage.table().rows();
|
||||
|
||||
assertEquals(1, resultList.size());
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='CODE_TO_TOKEN']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='Client']/../td[text()='customer-portal']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='IP Address']/../td[text()='127.0.0.1' or text()='0:0:0:0:0:0:0:1']"));
|
||||
resultList.get(0).findElement(By.xpath(".//td[text()='refresh_token_type']/../td[text()='Refresh']"));
|
||||
|
||||
String serverLogPath = null;
|
||||
|
||||
if (System.getProperty("app.server").equals("wildfly") || System.getProperty("app.server").equals("eap6") || System.getProperty("app.server").equals("eap")) {
|
||||
serverLogPath = System.getProperty("app.server.home") + "/standalone/log/server.log";
|
||||
}
|
||||
|
||||
String appServerUrl;
|
||||
if (Boolean.parseBoolean(System.getProperty("app.server.ssl.required"))) {
|
||||
appServerUrl = "https://localhost:" + System.getProperty("app.server.https.port", "8543") + "/";
|
||||
} else {
|
||||
appServerUrl = "http://localhost:" + System.getProperty("app.server.http.port", "8280") + "/";
|
||||
}
|
||||
|
||||
if (serverLogPath != null) {
|
||||
log.info("Checking app server log at: " + serverLogPath);
|
||||
File serverLog = new File(serverLogPath);
|
||||
String serverLogContent = FileUtils.readFileToString(serverLog);
|
||||
UserRepresentation bburke = ApiUtil.findUserByUsername(testRealmResource(), "bburke@redhat.com");
|
||||
|
||||
Pattern pattern = Pattern.compile("User '" + bburke.getId() + "' invoking '" + appServerUrl + "customer-portal\\/customers\\/view\\.jsp[^\\s]+' on client 'customer-portal'");
|
||||
Matcher matcher = pattern.matcher(serverLogContent);
|
||||
|
||||
assertTrue(matcher.find());
|
||||
assertTrue(serverLogContent.contains("User '" + bburke.getId() + "' invoking '" + appServerUrl + "database/customers' on client 'database-service'"));
|
||||
} else {
|
||||
log.info("Checking app server log on app-server: \"" + System.getProperty("app.server") + "\" is not supported.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.graphene.page.Page;
|
||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
|
||||
import org.keycloak.testsuite.adapter.page.SAMLPostEncExample;
|
||||
import org.keycloak.testsuite.adapter.page.SAMLPostSigExample;
|
||||
import org.keycloak.testsuite.adapter.page.SAMLRedirectSigExample;
|
||||
import org.keycloak.testsuite.util.URLAssert;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.keycloak.testsuite.auth.page.AuthRealm.SAMLDEMO;
|
||||
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
|
||||
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
public abstract class AbstractSAMLExampleAdapterTest extends AbstractExampleAdapterTest {
|
||||
|
||||
@Page
|
||||
private SAMLPostSigExample samlPostSigExamplePage;
|
||||
|
||||
@Page
|
||||
private SAMLPostEncExample samlPostEncExamplePage;
|
||||
|
||||
@Page
|
||||
private SAMLRedirectSigExample samlRedirectSigExamplePage;
|
||||
|
||||
@Override
|
||||
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
||||
RealmRepresentation samlRealm = loadRealm(new File(EXAMPLES_HOME_DIR + "/saml/testsaml.json"));
|
||||
testRealms.add(samlRealm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultPageUriParameters() {
|
||||
super.setDefaultPageUriParameters();
|
||||
testRealmPage.setAuthRealm(SAMLDEMO);
|
||||
testRealmSAMLRedirectLoginPage.setAuthRealm(SAMLDEMO);
|
||||
testRealmSAMLPostLoginPage.setAuthRealm(SAMLDEMO);
|
||||
}
|
||||
|
||||
@Deployment(name = SAMLPostSigExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive samlPostSigExampleDeployment() throws IOException {
|
||||
return exampleDeployment(SAMLPostSigExample.DEPLOYMENT_NAME);
|
||||
}
|
||||
|
||||
@Deployment(name = SAMLPostEncExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive samlPostEncExampleDeployment() throws IOException {
|
||||
return exampleDeployment(SAMLPostEncExample.DEPLOYMENT_NAME);
|
||||
}
|
||||
|
||||
@Deployment(name = SAMLRedirectSigExample.DEPLOYMENT_NAME)
|
||||
private static WebArchive samlRedirectSigExampleDeployment() throws IOException {
|
||||
return exampleDeployment(SAMLRedirectSigExample.DEPLOYMENT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void samlPostWithSignatureExampleTest() {
|
||||
samlPostSigExamplePage.navigateTo();
|
||||
testRealmSAMLPostLoginPage.form().login(bburkeUser);
|
||||
|
||||
waitUntilElement(By.xpath("//body")).text().contains("Welcome to the Sales Tool, " + bburkeUser.getUsername());
|
||||
|
||||
samlPostSigExamplePage.logout();
|
||||
waitUntilElement(By.xpath("//body")).text().contains("Logged out.");
|
||||
|
||||
samlPostSigExamplePage.navigateTo();
|
||||
URLAssert.assertCurrentUrlStartsWith(testRealmSAMLPostLoginPage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void samlPostWithEncryptionExampleTest() {
|
||||
samlPostEncExamplePage.navigateTo();
|
||||
|
||||
testRealmSAMLPostLoginPage.form().login(bburkeUser);
|
||||
|
||||
waitUntilElement(By.xpath("//body")).text().contains("Welcome to the Sales Tool, " + bburkeUser.getUsername());
|
||||
|
||||
samlPostEncExamplePage.logout();
|
||||
waitUntilElement(By.xpath("//body")).text().contains("Logged out.");
|
||||
|
||||
samlPostEncExamplePage.navigateTo();
|
||||
URLAssert.assertCurrentUrlStartsWith(testRealmSAMLPostLoginPage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void samlRedirectWithSignatureExampleTest() {
|
||||
samlRedirectSigExamplePage.navigateTo();
|
||||
|
||||
testRealmSAMLRedirectLoginPage.form().login(bburkeUser);
|
||||
|
||||
waitUntilElement(By.xpath("//body")).text().contains("Welcome to the Employee Tool,");
|
||||
|
||||
samlRedirectSigExamplePage.logout();
|
||||
URLAssert.assertCurrentUrlStartsWith(testRealmSAMLRedirectLoginPage);
|
||||
|
||||
samlRedirectSigExamplePage.navigateTo();
|
||||
URLAssert.assertCurrentUrlStartsWith(testRealmSAMLRedirectLoginPage);
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-eap")
|
||||
public class EAPBasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-eap")
|
||||
public class EAPDemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-eap")
|
||||
public class EAPSAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-eap6")
|
||||
public class EAP6BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-eap6")
|
||||
public class EAP6DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-eap6")
|
||||
public class EAP6SAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class RelativeEAPBasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fkiss
|
||||
*/
|
||||
public class RelativeEAPCorsExampleAdapterTest extends AbstractCorsExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
public class RelativeEAPDemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author mhajas
|
||||
*/
|
||||
public class RelativeEAPSAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-remote")
|
||||
public class RemoteBasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-remote")
|
||||
public class RemoteDemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-remote")
|
||||
public class RemoteSAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly")
|
||||
public class WildflyDemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly")
|
||||
public class WildflySAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly10")
|
||||
public class Wildfly10BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly10")
|
||||
public class Wildfly10DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly10")
|
||||
public class Wildfly10SAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly8")
|
||||
public class Wildfly8BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly8")
|
||||
public class Wildfly8DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly9")
|
||||
public class Wildfly9BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly9")
|
||||
public class Wildfly9DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
*/
|
||||
@AppServerContainer("app-server-wildfly9")
|
||||
public class Wildfly9SAMLExampleAdapterTest extends AbstractSAMLExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -265,24 +265,6 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.example.demo</groupId>
|
||||
<artifactId>product-portal-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.example.demo</groupId>
|
||||
<artifactId>customer-portal-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.example.demo</groupId>
|
||||
<artifactId>database-service</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>integration-arquillian-test-apps-js-console</artifactId>
|
||||
|
@ -295,48 +277,6 @@
|
|||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>examples-multitenant</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>examples-basicauth</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.example.demo</groupId>
|
||||
<artifactId>cors-angular-product-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.example.demo</groupId>
|
||||
<artifactId>cors-database-service</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>sales-post-sig</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>saml-post-encryption</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>saml-redirect-signatures</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>hello-world-authz-service</artifactId>
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat7")
|
||||
public class Tomcat7BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat7")
|
||||
public class Tomcat7DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat8")
|
||||
public class Tomcat8BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat8")
|
||||
public class Tomcat8DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat9")
|
||||
public class Tomcat9BasicAuthExampleAdapterTest extends AbstractBasicAuthExampleAdapterTest {
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.keycloak.testsuite.adapter.example;
|
||||
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@AppServerContainer("app-server-tomcat9")
|
||||
public class Tomcat9DemoExampleAdapterTest extends AbstractDemoExampleAdapterTest {
|
||||
|
||||
}
|
Loading…
Reference in a new issue