use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.
the class FlowMultipleWarTest method testFlows.
@Test
@RunAsClient
public void testFlows(@ArquillianResource @OperateOnDeployment(WAR1) URL war1Context, @ArquillianResource @OperateOnDeployment(WAR2) URL war2Context) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
WebClient client = new WebClient();
testFlow(client, war1Context);
testFlow(client, war2Context);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.
the class ManagedBeansWithCDITest method testManagedBeansWithCDI.
@Test
@RunAsClient
public void testManagedBeansWithCDI(@ArquillianResource URL url) throws Exception {
WebClient client = new WebClient();
client.getPage(url + "/index.faces");
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project core by weld.
the class Weld1037Test method testRedirectInPreRenderViewAction.
@Test
@RunAsClient
public void testRedirectInPreRenderViewAction(@ArquillianResource URL url) throws Exception {
WebClient client = new WebClient();
client.setRedirectEnabled(false);
client.setThrowExceptionOnFailingStatusCode(false);
Page page = client.getPage(url + "/doRedirect.faces");
assertEquals("Expected redirect:", HttpServletResponse.SC_MOVED_TEMPORARILY, page.getWebResponse().getStatusCode());
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project jbpm by kiegroup.
the class RestServiceInvokeTest method testPost.
@Test
@RunAsClient
public void testPost() throws Exception {
System.out.println("### Running proccess ...");
KieSession ksession = getSession(rrs.getResource(RegisterRestService.BPMN_CALL_REST_SERVICE));
ksession.getWorkItemManager().registerWorkItemHandler("REST", new RESTWorkItemHandler());
HashMap<String, Object> arguments = new HashMap<String, Object>();
arguments.put("Url", RegisterRestService.SERVICE_URL + "PersonList/add");
arguments.put("Method", "POST");
arguments.put("ContentType", "application/json");
arguments.put("Content", "{ \"name\": \"Marek\", \"middlename\": \"-\", \"surname\": \"Baluch\" }");
WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(RegisterRestService.PROCESS_CALL_REST_SERVICE, arguments);
Assertions.assertThat(pi.getVariable("Result")).as("REST call failed - Wrong response.").isEqualTo("Ok");
Assertions.assertThat(pi.getVariable("Status")).as("REST call failed - Wrong status code.").isEqualTo(200);
Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
use of org.jboss.arquillian.container.test.api.RunAsClient in project jbpm by kiegroup.
the class RestServiceInvokeTest method testGet.
@Test
@RunAsClient
public void testGet() throws Exception {
System.out.println("### Running proccess ...");
KieSession ksession = getSession(rrs.getResource(RegisterRestService.BPMN_CALL_REST_SERVICE_SIMPLE));
ksession.getWorkItemManager().registerWorkItemHandler("REST", new RESTWorkItemHandler());
HashMap<String, Object> arguments = new HashMap<String, Object>();
arguments.put("Url", RegisterRestService.SERVICE_URL + "PersonList/ping");
WorkflowProcessInstance pi = (WorkflowProcessInstance) ksession.startProcess(RegisterRestService.PROCESS_CALL_REST_SERVICE_SIMPLE, arguments);
Assertions.assertThat(pi.getVariable("Result")).as("REST call failed - Wrong response.").isEqualTo("pong");
Assertions.assertThat(pi.getVariable("Status")).as("REST call failed - Wrong status code.").isEqualTo(200);
Assertions.assertThat(pi.getState()).as("Process did not finish").isEqualTo(ProcessInstance.STATE_COMPLETED);
}
Aggregations