Created
June 4, 2016 07:23
-
-
Save slawekradzyminski/b45d3f7955482b04dbbbc5ad003b37b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String EXPECTED_MD5 = "c3fb273e2843808968d68120121f2c74"; | |
@Test | |
public void getDownloadPlusMd5() throws Exception { | |
Request request = prepareRequest(); | |
File downloadedFile = request.downloadFile(); | |
assertThat(calculateMd5(downloadedFile)).isEqualTo(EXPECTED_MD5); | |
} | |
private String calculateMd5(File downloadedFile) throws IOException { | |
FileInputStream fis = new FileInputStream(downloadedFile); | |
String md5 = md5Hex(fis); | |
fis.close(); | |
return md5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment