Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To where was HttpClient's LocalTestServer moved?

I've read about how HttpClient's LocalTestServer can be used for automated testing, however I can't seem to find where it's been moved. I tried defining dependency to httpclient with tests classifier:

'org.apache.httpcomponents:httpclient:4.5.2:tests'

but there doesn't seem to be a LocalTestServer class defined in there. Has this been discontinued?

like image 762
Psycho Punch Avatar asked Apr 24 '16 16:04

Psycho Punch


1 Answers

Your test should now extend org.apache.http.localserver.LocalServerTestBase.

This is available in the httpclient module with classifier tests.

Your pom could look like:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.2</version>
    <scope>test</scope>
    <classifier>tests</classifier>
</dependency>

Related issue:

https://issues.apache.org/jira/browse/HTTPCLIENT-1172

Related changeset:

https://github.com/apache/httpclient/commit/2ebd8202849c1f4a17d4320543e315a46cbfdc10

like image 168
William Bakker Avatar answered Oct 12 '22 02:10

William Bakker