@Test
public void downloadFileWritesTheFileToDisk() throws Exception {

    wireMockRule.stubFor(get(urlPathEqualTo(FILE_REQUEST))
            .willReturn(aResponse().withStatus(HttpConstants.STATUS_OK)
                    .withBody(TEST_CONTENT)));
    Path targetDirectory = temporaryFolder.newFolder("target").toPath();
    Path resultFile = httpHelper.downloadFile(wireMockRule.url(FILE_REQUEST), targetDirectory).toPath();
    checkDownloadedFile(targetDirectory, resultFile);
}