Closed gingeleski closed 4 years ago
Gradle include:
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
Actually I think this is sufficient for now.
Really the application under test needs to develop further before the more "exotic" test cases can be exercised on it.
At which time, the specifics of leveraging Apache HttpComponents (HttpClient) should probably warrant separate issues.
In the Aspect client project on which this is predominantly based, I used the Apache HttpComponents library for request making because of the superior control they allow over minute attributes. I am again finding that it is required.
For example, the RestTemplate forces Content-Type header if it doesn't find one when a request is fired. It guesses, which is great for normal circumstances, not for the security tests. One test case tries to see how the server responds when there is no Content-Type header.
In another example, we're going to have a test case that fires an
HTTP/1.0
(as opposed toHTTP/1.1
) request at the server, with noHost
header. Current request-making methodology can't do the first part and I suspect it'll force the second part just like it doesContent-Type
.Hence, for making HTTP requests in the integration test cases, we need Apache HttpComponents and not RestTemplate.