Remove unknown HttpContext-based test as it fails unpredictably on different JVMs

This commit is contained in:
Chris Earle 2016-08-30 17:18:01 -04:00
parent 459e3c15a6
commit c05d5f9257
1 changed files with 0 additions and 30 deletions

View File

@ -207,36 +207,6 @@ public class RestClientIntegTests extends RestClientTestCase {
bodyTest("GET"); bodyTest("GET");
} }
/**
* Ensure that pathPrefix works as expected even when the path does not exist.
*/
public void testPathPrefixUnknownPath() throws IOException {
// guarantee no other test setup collides with this one and lets it sneak through
final String uniqueContextSuffix = "/testPathPrefixUnknownPath";
final String pathPrefix = "dne/" + randomAsciiOfLengthBetween(1, 5) + "/";
final int statusCode = randomStatusCode(getRandom());
try (final RestClient client =
RestClient.builder(new HttpHost(httpServer.getAddress().getHostString(), httpServer.getAddress().getPort()))
.setPathPrefix((randomBoolean() ? "/" : "") + pathPrefix).build()) {
for (final String method : getHttpMethods()) {
Response esResponse;
try {
esResponse = client.performRequest(method, "/" + statusCode + uniqueContextSuffix);
if ("HEAD".equals(method) == false) {
fail("only HEAD requests should not throw an exception; 404 is expected");
}
} catch(ResponseException e) {
esResponse = e.getResponse();
}
assertThat(esResponse.getRequestLine().getUri(), equalTo("/" + pathPrefix + statusCode + uniqueContextSuffix));
assertThat(esResponse.getStatusLine().getStatusCode(), equalTo(404));
}
}
}
/** /**
* Ensure that pathPrefix works as expected. * Ensure that pathPrefix works as expected.
*/ */