use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.
the class BonitaStartProducer method process.
public void process(Exchange exchange) throws Exception {
// Setup access type (HTTP on local host)
String hostname = this.configuration.getHostname();
String port = this.configuration.getPort();
String processName = this.configuration.getProcessName();
String username = this.configuration.getUsername();
String password = this.configuration.getPassword();
BonitaAPIConfig bonitaAPIConfig = new BonitaAPIConfig(hostname, port, username, password);
BonitaAPI bonitaApi = BonitaAPIBuilder.build(bonitaAPIConfig);
ProcessDefinitionResponse processDefinition = bonitaApi.getProcessDefinition(processName);
bonitaApi.startCase(processDefinition, exchange.getIn().getBody(Map.class));
}
use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.
the class BonitaAPITest method testGetProcessDefinitionEmptyInput.
@Test(expected = IllegalArgumentException.class)
public void testGetProcessDefinitionEmptyInput() {
BonitaAPI bonitaApi = BonitaAPIBuilder.build(new BonitaAPIConfig("hostname", "port", "username", "password"));
bonitaApi.getProcessDefinition("");
}
use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.
the class BonitaAuthFilterConnectionTest method testConnectionSupportCSRF.
@Test
public void testConnectionSupportCSRF() throws Exception {
String port = wireMockRule.port() + "";
stubFor(post(urlEqualTo("/bonita/loginservice")).willReturn(aResponse().withHeader("Set-Cookie", "JSESSIONID=something", "X-Bonita-API-Token=something")));
BonitaAPIConfig bonitaApiConfig = new BonitaAPIConfig("localhost", port, "username", "password");
BonitaAuthFilter bonitaAuthFilter = new BonitaAuthFilter(bonitaApiConfig);
bonitaAuthFilter.filter(requestContext);
assertEquals(2, requestContext.getHeaders().size());
}
use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.
the class BonitaAuthFilterTest method testBonitaAuthFilterUsernameEmpty.
@Test(expected = IllegalArgumentException.class)
public void testBonitaAuthFilterUsernameEmpty() throws IOException {
BonitaAPIConfig bonitaApiConfig = new BonitaAPIConfig("localhost", "port", "", "password");
BonitaAuthFilter bonitaAuthFilter = new BonitaAuthFilter(bonitaApiConfig);
bonitaAuthFilter.filter(requestContext);
}
use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.
the class BonitaAPITest method testStartCaseEmptyProcessDefinitionId.
@Test(expected = IllegalArgumentException.class)
public void testStartCaseEmptyProcessDefinitionId() throws Exception {
BonitaAPI bonitaApi = BonitaAPIBuilder.build(new BonitaAPIConfig("hostname", "port", "username", "password"));
bonitaApi.startCase(null, new HashMap<String, Serializable>());
}
Aggregations