Search in sources :

Example 6 with BonitaAPIConfig

use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.

the class BonitaAPITest method testStartCaseNUllContractInput.

@Test(expected = IllegalArgumentException.class)
public void testStartCaseNUllContractInput() throws Exception {
    BonitaAPI bonitaApi = BonitaAPIBuilder.build(new BonitaAPIConfig("hostname", "port", "username", "password"));
    ProcessDefinitionResponse processDefinition = new ProcessDefinitionResponse();
    bonitaApi.startCase(processDefinition, null);
}
Also used : ProcessDefinitionResponse(org.apache.camel.component.bonita.api.model.ProcessDefinitionResponse) BonitaAPIConfig(org.apache.camel.component.bonita.api.util.BonitaAPIConfig) Test(org.junit.Test)

Example 7 with BonitaAPIConfig

use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.

the class BonitaAuthFilterAlreadyConnectedTest method testAlreadyConnected.

@Test
public void testAlreadyConnected() throws Exception {
    BonitaAPIConfig bonitaApiConfig = new BonitaAPIConfig("hostname", "port", "username", "password");
    BonitaAuthFilter bonitaAuthFilter = new BonitaAuthFilter(bonitaApiConfig);
    bonitaAuthFilter.filter(requestContext);
}
Also used : BonitaAPIConfig(org.apache.camel.component.bonita.api.util.BonitaAPIConfig) BonitaAuthFilter(org.apache.camel.component.bonita.api.filter.BonitaAuthFilter) Test(org.junit.Test)

Example 8 with BonitaAPIConfig

use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.

the class BonitaAuthFilterConnectionTest method testConnection.

@Test
public void testConnection() throws Exception {
    String port = wireMockRule.port() + "";
    stubFor(post(urlEqualTo("/bonita/loginservice")).willReturn(aResponse().withHeader("Set-Cookie", "JSESSIONID=something")));
    BonitaAPIConfig bonitaApiConfig = new BonitaAPIConfig("localhost", port, "username", "password");
    BonitaAuthFilter bonitaAuthFilter = new BonitaAuthFilter(bonitaApiConfig);
    bonitaAuthFilter.filter(requestContext);
    assertEquals(1, requestContext.getHeaders().size());
}
Also used : BonitaAPIConfig(org.apache.camel.component.bonita.api.util.BonitaAPIConfig) BonitaAuthFilter(org.apache.camel.component.bonita.api.filter.BonitaAuthFilter) Test(org.junit.Test)

Example 9 with BonitaAPIConfig

use of org.apache.camel.component.bonita.api.util.BonitaAPIConfig in project camel by apache.

the class BonitaAuthFilterTest method testBonitaAuthFilterPasswordEmpty.

@Test(expected = IllegalArgumentException.class)
public void testBonitaAuthFilterPasswordEmpty() throws IOException {
    BonitaAPIConfig bonitaApiConfig = new BonitaAPIConfig("localhost", "port", "username", "");
    BonitaAuthFilter bonitaAuthFilter = new BonitaAuthFilter(bonitaApiConfig);
    bonitaAuthFilter.filter(requestContext);
}
Also used : BonitaAPIConfig(org.apache.camel.component.bonita.api.util.BonitaAPIConfig) BonitaAuthFilter(org.apache.camel.component.bonita.api.filter.BonitaAuthFilter) Test(org.junit.Test)

Aggregations

BonitaAPIConfig (org.apache.camel.component.bonita.api.util.BonitaAPIConfig)9 Test (org.junit.Test)8 BonitaAuthFilter (org.apache.camel.component.bonita.api.filter.BonitaAuthFilter)5 ProcessDefinitionResponse (org.apache.camel.component.bonita.api.model.ProcessDefinitionResponse)2 Serializable (java.io.Serializable)1 Map (java.util.Map)1 BonitaAPI (org.apache.camel.component.bonita.api.BonitaAPI)1