use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class OpenIdELPerSessionTest method testOpenIdConnect2Tenants.
/**
* Tests that it's possible to authenticate as 2 different tenants in 2 sessions. Tenant specifies a provider, each session should use a different OIDC provider and authenticate as a different user. Tenant-specific configuration is in microprofile-config.properties.
*/
@Test
@RunAsClient
public void testOpenIdConnect2Tenants() throws IOException {
WebClient clientForSecondTenant = new WebClient();
OpenIdTestUtil.testOpenIdConnect2Tenants(base, webClient, clientForSecondTenant);
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class PayaraExpressionConfigPropertiesIT method testAliasSubstitution.
@Test
public void testAliasSubstitution() throws Exception {
try (WebClient client = new WebClient()) {
TextPage page = client.getPage(url + "ConfigServlet");
System.out.println(page.getContent());
assertTrue("Expected \"Normal Notation\" to give wobbles", page.getContent().contains("Normal Notation: wobbles"));
assertTrue("Expected \"Substitution Notation\" to give wobbles", page.getContent().contains("Substitution Notation: wobbles"));
assertTrue("Expected \"Password Alias from File\" to give wobbles", page.getContent().contains("Password Alias from File: wobbles"));
assertTrue("Expected \"System Property Alias from File\" to give Tiddles!", page.getContent().contains("System Property Alias from File: Tiddles!"));
assertTrue("Expected \"Environment Variable Alias referencing System Property Alias from File\" to give Dobbles", page.getContent().contains("Environment Variable Alias referencing System Property Alias from File: Dobbles"));
assertTrue("Expected \"Environment Variable Alias and System Property Alias from File (same property)\" to give Bibbles and Bobbles", page.getContent().contains("Environment Variable Alias and System Property Alias from File (same property): Bibbles and Bobbles"));
}
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class InvalidRedirectURITest method testOpenIdConnect.
@Test
@RunAsClient
public void testOpenIdConnect() throws IOException {
try {
WebClient webClient = new WebClient();
webClient.getPage(base + "Secured");
fail("redirect uri is valid");
} catch (FailingHttpStatusCodeException ex) {
assertEquals(NOT_FOUND.getStatusCode(), ex.getStatusCode());
}
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class OpenIdELPerSessionInEarTest method testOpenIdConnect2Tenants.
/**
* Tests that it's possible to authenticate as 2 different tenants in 2
* sessions. Tenant specifies a provider, each session should use a
* different OIDC provider and authenticate as a different user.
* Tenant-specific configuration is in microprofile-config.properties.
*/
@Test
@RunAsClient
public void testOpenIdConnect2Tenants() throws IOException {
WebClient clientForSecondTenant = new WebClient();
OpenIdTestUtil.testOpenIdConnect2Tenants(base, webClient, clientForSecondTenant);
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class UseCookiesTest method testOpenIdConnect.
@Test
@RunAsClient
public void testOpenIdConnect() throws IOException {
WebClient webClient = new WebClient();
URL baseHttps = ServerOperations.createClientTrustStore(webClient, base, ServerOperations.addClientCertificateFromServer(base));
OpenIdTestUtil.testOpenIdConnect(webClient, baseHttps);
}
Aggregations