@Test(expected = IOException.class)
public void downloadFileThrowsExceptionOn404StatusCode() throws Exception {

    wireMockRule.stubFor(get(anyUrl())
            .willReturn(aResponse().withStatus(HttpConstants.STATUS_ERR_NOT_FOUND)));
    Path targetDirectory = temporaryFolder.newFolder("target").toPath();
    httpHelper.downloadFile(wireMockRule.url("/test"), targetDirectory);
}