use of org.apache.camel.component.bonita.api.filter.BonitaAuthFilter 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());
}
use of org.apache.camel.component.bonita.api.filter.BonitaAuthFilter 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);
}
Aggregations