use of org.jboss.arquillian.container.test.api.RunAsClient in project oxAuth by GluuFederation.
the class GluuConfigurationWSTest method getConfigurationTest.
@RunAsClient
@Parameters({ "gluuConfigurationPath", "webTarget" })
@Consumes(MediaType.APPLICATION_JSON)
@Test
public void getConfigurationTest(String gluuConfigurationPath, @Optional @ArquillianResteasyResource("seam/resource") final WebTarget webTarget) throws Exception {
Response response = webTarget.path(gluuConfigurationPath).request().get();
String entity = response.readEntity(String.class);
BaseTest.showResponse("UMA : TConfiguration.configuration", response, entity);
assertEquals(response.getStatus(), 200, "Unexpected response code.");
try {
GluuConfiguration appConfiguration = ServerUtil.createJsonMapper().readValue(entity, GluuConfiguration.class);
System.err.println(appConfiguration.getIdGenerationEndpoint());
assertNotNull(appConfiguration, "Meta data configuration is null");
assertNotNull(appConfiguration.getIdGenerationEndpoint());
assertNotNull(appConfiguration.getIntrospectionEndpoint());
assertNotNull(appConfiguration.getAuthLevelMapping());
assertNotNull(appConfiguration.getScopeToClaimsMapping());
} catch (IOException e) {
e.printStackTrace();
fail();
}
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project kie-wb-common by kiegroup.
the class StandaloneControllerIT method testEmbeddedRestEndpoint.
@Test
@RunAsClient
@OperateOnDeployment("workbench")
public void testEmbeddedRestEndpoint(@ArquillianResource final URL baseURL) throws Exception {
final String controllerURL = baseURL + "rest/controller";
try {
KieServerControllerClient client = KieServerControllerClientFactory.newRestClient(controllerURL, USER, PASSWORD);
client.listServerTemplates();
fail("Connection to embedded controller endpoint should fail");
} catch (KieServerControllerHTTPClientException ex) {
assertEquals(404, ex.getResponseCode());
}
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly-swarm by wildfly-swarm.
the class SWARM582Test method testServletAsWebServiceClientWithHandler.
@Test
@RunAsClient
public void testServletAsWebServiceClientWithHandler() throws Exception {
URL url = new URL("http://localhost:8080/clientWithHandler?message=" + URLEncoder.encode(MESSAGE, StandardCharsets.UTF_8.name()));
final String response = readResponse(url);
assertThat(response).isEqualTo("ECHO:" + MESSAGE);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class LoginTest method loginAsNewUser.
/**
* Create a new user and try to login with its credentials.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void loginAsNewUser(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
// create a random user
UserRestClient userClient = new UserRestClient(deploymentUrl);
UserVO user = userClient.createRandomUser();
// load dmz
loginPage.assertOnLoginPage();
// login
loginPage.loginAs(user.getLogin(), user.getPassword());
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project OpenOLAT by OpenOLAT.
the class UserTest method movePortletToTheTop.
/**
* Go to the portal, edit it, move the notes to the
* top, quit editing, check the notes are the first
* portlet in the view mode.
*
* @param loginPage
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void movePortletToTheTop(@InitialPage LoginPage loginPage) throws IOException, URISyntaxException {
UserVO user = new UserRestClient(deploymentUrl).createRandomUser();
loginPage.loginAs(user.getLogin(), user.getPassword());
PortalPage portal = navBar.openPortal().assertPortlet(PortalPage.notesBy).edit().moveLeft(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveUp(PortalPage.notesBy).moveRight(PortalPage.quickStartBy).moveDown(PortalPage.quickStartBy);
// finish editing
portal.finishEditing();
// no inactive panel -> we are in view mode
List<WebElement> portalInactive = browser.findElements(PortalPage.inactiveBy);
Assert.assertTrue(portalInactive.isEmpty());
// notes must be first
List<WebElement> portlets = browser.findElements(By.className("o_portlet"));
Assert.assertFalse(portlets.isEmpty());
WebElement notesPortlet = portlets.get(0);
String cssClass = notesPortlet.getAttribute("class");
Assert.assertNotNull(cssClass);
Assert.assertTrue(cssClass.contains("o_portlet_notes"));
}
Aggregations