Skip to content

Commit add3415

Browse files
committed
Fixing a test - there is no reason for one of the tests to modify a value created in the initial setup method for all the tests to use; since tests are not run in any obvious/intuitive order, this can lead to unexpected results. #9620
1 parent dd21fe0 commit add3415

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/edu/harvard/iq/dataverse/api/AccessIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public void testRequestAccess() throws InterruptedException {
499499
basicFileName = "004.txt";
500500
String basicPathToFile = "scripts/search/data/replace_test/" + basicFileName;
501501
Response basicAddResponse = UtilIT.uploadFileViaNative(datasetIdNew.toString(), basicPathToFile, apiToken);
502-
basicFileId = JsonPath.from(basicAddResponse.body().asString()).getInt("data.files[0].dataFile.id");
502+
Integer basicFileIdNew = JsonPath.from(basicAddResponse.body().asString()).getInt("data.files[0].dataFile.id");
503503

504504
String tabFile3NameRestrictedNew = "stata13-auto-withstrls.dta";
505505
String tab3PathToFile = "scripts/search/data/tabular/" + tabFile3NameRestrictedNew;
@@ -557,7 +557,7 @@ public void testRequestAccess() throws InterruptedException {
557557
assertEquals(400, requestFileAccessResponse.getStatusCode());
558558

559559
//if you make a request of a public file you should also get a command exception
560-
requestFileAccessResponse = UtilIT.requestFileAccess(basicFileId.toString(), apiTokenRando);
560+
requestFileAccessResponse = UtilIT.requestFileAccess(basicFileIdNew.toString(), apiTokenRando);
561561
assertEquals(400, requestFileAccessResponse.getStatusCode());
562562

563563

0 commit comments

Comments
 (0)