Skip to content

Commit

Permalink
[hotfix] Harden JarUploadHandlerTest#testUploadJar
Browse files Browse the repository at this point in the history
Use lastIndexOf("_") instead of indexOf("_") in order to find the file name part
  • Loading branch information
tillrohrmann committed Jul 18, 2018
1 parent 4095a31 commit 5a89b9a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testUploadJar() throws Exception {
assertThat(jarUploadResponseBody.getStatus(), equalTo(JarUploadResponseBody.UploadStatus.success));
final String returnedFileNameWithUUID = jarUploadResponseBody.getFilename();
assertThat(returnedFileNameWithUUID, containsString("_"));
final String returnedFileName = returnedFileNameWithUUID.substring(returnedFileNameWithUUID.indexOf("_") + 1);
final String returnedFileName = returnedFileNameWithUUID.substring(returnedFileNameWithUUID.lastIndexOf("_") + 1);
assertThat(returnedFileName, equalTo(uploadedFile.getFileName().toString()));
}

Expand Down

0 comments on commit 5a89b9a

Please sign in to comment.