Search in sources :

Example 1 with BasicAuthClientHttpRequestFactory

use of com.consol.citrus.http.client.BasicAuthClientHttpRequestFactory in project citrus-samples by christophd.

the class EndpointConfig method basicAuthRequestFactoryBean.

@Bean
public BasicAuthClientHttpRequestFactory basicAuthRequestFactoryBean() {
    BasicAuthClientHttpRequestFactory requestFactory = new BasicAuthClientHttpRequestFactory();
    AuthScope authScope = new AuthScope("localhost", port, "", "basic");
    requestFactory.setAuthScope(authScope);
    UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("citrus", "secr3t");
    requestFactory.setCredentials(credentials);
    return requestFactory;
}
Also used : BasicAuthClientHttpRequestFactory(com.consol.citrus.http.client.BasicAuthClientHttpRequestFactory) AuthScope(org.apache.http.auth.AuthScope) UsernamePasswordCredentials(org.apache.http.auth.UsernamePasswordCredentials) Bean(org.springframework.context.annotation.Bean)

Aggregations

BasicAuthClientHttpRequestFactory (com.consol.citrus.http.client.BasicAuthClientHttpRequestFactory)1 AuthScope (org.apache.http.auth.AuthScope)1 UsernamePasswordCredentials (org.apache.http.auth.UsernamePasswordCredentials)1 Bean (org.springframework.context.annotation.Bean)1