### Question:
DownloadOkHttp3Connection implements DownloadConnection, DownloadConnection.Connected { @Override public String getRedirectLocation() { final Response priorRes = response.priorResponse(); if (priorRes != null && response.isSuccessful() && RedirectUtil.isRedirect(priorRes.code())) { return response.request().url().toString(); } return null; } DownloadOkHttp3Connection(@NonNull OkHttpClient client,
                              @NonNull Request.Builder requestBuilder);   DownloadOkHttp3Connection(@NonNull OkHttpClient client, @NonNull String url); @Override void addHeader(String name, String value); @Override Connected execute(); @Override void release(); @Override Map<String, List<String>> getRequestProperties(); @Override String getRequestProperty(String key); @Override int getResponseCode(); @Override InputStream getInputStream(); @Override boolean setRequestMethod(@NonNull String method); @Override Map<String, List<String>> getResponseHeaderFields(); @Override String getResponseHeaderField(String name); @Override String getRedirectLocation();  }### Answer:
@Test public void getRedirectLocation() { final Response.Builder responseBuilder = createResponseBuilder(); connection.response = responseBuilder.build(); assertThat(connection.getRedirectLocation()).isEqualTo(null); final Response priorRes = new Response.Builder() .protocol(Protocol.HTTP_1_1) .code(302) .request(new Request.Builder().url("http: .message("message") .build(); connection.response = responseBuilder .priorResponse(priorRes) .build(); assertThat(connection.getRedirectLocation()).isEqualTo("http: }