### Question:
SimpleHttpGetDataLoader implements DataLoader { protected byte[] request(String url, boolean refresh) { HttpURLConnection connection = null; try { connection = openAndConfigureConnection(getHttpUrl(url, Optional.empty()), refresh); if (followRedirects > 0) { connection = followRedirects(connection, refresh); } return readFromConnection(connection); } catch (IOException e) { throw new IllegalStateException("Failed to read from '" + url + "': " + e.getMessage(), e); } finally { if (connection != null) connection.disconnect(); } }  @Override byte[] get(String url); @Override DataAndUrl get(List<String> urlStrings); @Override byte[] get(String url, boolean refresh); @Override byte[] post(String url, byte[] content); @Override void setContentType(String contentType); void setUserAgent(String userAgent); String getUserAgent(); void setFollowRedirects(int followRedirects); int getFollowRedirects(); void setConnectTimeout(int connectTimeout); int getConnectTimeout(); void setReadTimeout(int readTimeout); int getReadTimeout();  }### Answer:
@Test public void requestShouldFollowRedirectsOfValidCertificate() { byte[] response = createDataLoader(2).request("http: CertificateToken loadedCertificate = DSSUtils.loadCertificate(response); Assert.assertTrue( "Certificate subject principal should contain 'CN=EE Certification Centre Root CA'", loadedCertificate.getSubjectX500Principal().getName().contains("CN=EE Certification Centre Root CA") ); assertLogInOrder( Matchers.matchesPattern("Received HTTP 3[0-9]{2} from 'http: Matchers.matchesPattern("Received HTTP 3[0-9]{2} from 'https: Matchers.matchesPattern("Reading response of specific size: [0-9]+") ); }