@Test
public void downloadFileNameCanBeOverwritten() throws IOException {

    final String downloadUri = "/foo/bar.txt";
    wireMockRule.stubFor(get(urlPathEqualTo(downloadUri))
            .willReturn(aResponse().withStatus(HttpConstants.STATUS_OK)
                    .withBody(TEST_CONTENT)));
    Path targetDirectory = temporaryFolder.newFolder("target").toPath();
    Path resultFile =
            httpHelper.downloadFile(wireMockRule.url(downloadUri), targetDirectory, FILE_NAME).toPath();
    checkDownloadedFile(targetDirectory, resultFile);
}