Skip to content

Commit

Permalink
#4813 fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Jul 16, 2020
1 parent 9350502 commit 54011d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ private boolean step_040_auto_checkForDuplicates(){
this.duplicateFileWarningFound = true;
this.duplicateFileWarningString = BundleUtil.getStringFromBundle("file.addreplace.warning.duplicate_file",
Arrays.asList(dupeName));
this.addErrorWarning(getBundleErr("warning.duplicate_file") + " " + dupeName + " " + getBundleErr("duplicate_file.continue"));
this.addErrorWarning(this.duplicateFileWarningString);

}
finalFileList.add(df);
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ public void test_001_AddFileGood() {

msgt("2nd requests: " + addTwiceResponse.prettyPrint()); //addResponse.prettyPrint();

String errMsg = BundleUtil.getStringFromBundle("file.addreplace.error.warning.duplicate_file");
String errMsgFromResponse = JsonPath.from(addTwiceResponse.body().asString()).getString("message");
String dupeName = "dataverseproject.png";

String errMsg = BundleUtil.getStringFromBundle("file.addreplace.warning.duplicate_file",
Arrays.asList(dupeName));
String errMsgFromResponse = JsonPath.from(addTwiceResponse.body().asString()).getString("message");
addTwiceResponse.then().assertThat()
.statusCode(OK.getStatusCode());
assertTrue(errMsgFromResponse.contains(errMsg));
Expand Down

0 comments on commit 54011d7

Please sign in to comment.