therealmitchconnors
therealmitchconnors

Reputation: 2760

org.apache.http library missing package

I am writing unit tests for an application that hits another companies web servers using apache's httpclient (v4.2.3). I would like to mock the functionality of the web servers for reliable unit test results, and have found a few references to org.apache.http.localserver.LocalTestServer as an effective web server mocking tool, which is convenient since it is in a library I already depend on.

Unfortunately, grails cannot resolve the reference to LocalTestServer, though it can reference HttpClient just fine, and they appear to be in the same lib. Further research shows that some javadocs include the localserver package, and some do not. What do I need to do to reference and use this package?

Upvotes: 4

Views: 2555

Answers (1)

doelleri
doelleri

Reputation: 19682

In the blog reference you linked, if you check out the Maven dependency snippet in Basic Setup, notice the <classifier>tests</classifier>. The classifier is used to distinguish between different jars built from the same POM. Unfortunately, based on this JIRA I found, classifiers aren't supported until Grails 2.3.

If you download httpclient-4.2.3-tests.jar yourself into /lib you should be good to go though.

Upvotes: 7

Related Questions