use of org.jboss.pnc.client.ApacheHttpClient43EngineWithRetry in project pnc by project-ncl.
the class BuildEndpointTest method shouldGetSCMArchiveLink.
@Test
public void shouldGetSCMArchiveLink() throws ClientException, ReflectiveOperationException {
BuildClient client = new BuildClient(RestClientConfiguration.asAnonymous());
// Disable redirects so we can test the actual response
Field f = ClientBase.class.getDeclaredField("client");
f.setAccessible(true);
ResteasyClient reClient = (ResteasyClient) f.get(client);
ApacheHttpClient43EngineWithRetry engine = (ApacheHttpClient43EngineWithRetry) reClient.httpEngine();
engine.setFollowRedirects(false);
Response internalScmArchiveLink = client.getInternalScmArchiveLink(buildId);
assertThat(internalScmArchiveLink.getStatusInfo()).isEqualTo(Status.TEMPORARY_REDIRECT);
assertThat(internalScmArchiveLink.getHeaderString("Location")).isNotEmpty();
}
Aggregations