From 0e2f853aa57130d9ada16123b3690e20f4ac5090 Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Tue, 22 Aug 2023 14:38:22 -0400 Subject: [PATCH 1/2] fixes broken basic search (#9803) --- .../edu/harvard/iq/dataverse/search/SearchIncludeFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/search/SearchIncludeFragment.java b/src/main/java/edu/harvard/iq/dataverse/search/SearchIncludeFragment.java index e249b81c983..2ce06541afa 100644 --- a/src/main/java/edu/harvard/iq/dataverse/search/SearchIncludeFragment.java +++ b/src/main/java/edu/harvard/iq/dataverse/search/SearchIncludeFragment.java @@ -213,7 +213,7 @@ public String searchRedirect(String dataverseRedirectPage, Dataverse dataverseIn qParam = "&q=" + query; } - return widgetWrapper.wrapURL(dataverseRedirectPage + "?faces-redirect=true&q=" + qParam + optionalDataverseScope); + return widgetWrapper.wrapURL(dataverseRedirectPage + "?faces-redirect=true" + qParam + optionalDataverseScope); } From 8c259b528f91cb191558ee444231150f768777c1 Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Tue, 22 Aug 2023 18:15:52 -0400 Subject: [PATCH 2/2] fixing the intermittently-failing FilesIT test. #9803 --- .../java/edu/harvard/iq/dataverse/api/FilesIT.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java b/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java index 137cbee6b36..1b34d908a16 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java @@ -1399,8 +1399,8 @@ public void testGetFileInfo() { createUser = UtilIT.createRandomUser(); String apiTokenRegular = UtilIT.getApiTokenFromResponse(createUser); - msg("Add tabular file"); - String pathToFile = "scripts/search/data/tabular/stata13-auto-withstrls.dta"; + msg("Add a non-tabular file"); + String pathToFile = "scripts/search/data/binary/trees.png"; Response addResponse = UtilIT.uploadFileViaNative(datasetId.toString(), pathToFile, apiToken); String dataFileId = addResponse.getBody().jsonPath().getString("data.files[0].dataFile.id"); @@ -1412,10 +1412,12 @@ public void testGetFileInfo() { getFileDataResponse.prettyPrint(); getFileDataResponse.then().assertThat() - .body("data.label", equalTo("stata13-auto-withstrls.dta")) - .body("data.dataFile.filename", equalTo("stata13-auto-withstrls.dta")) + .body("data.label", equalTo("trees.png")) + .body("data.dataFile.filename", equalTo("trees.png")) + .body("data.dataFile.contentType", equalTo("image/png")) + .body("data.dataFile.filesize", equalTo(8361)) .statusCode(OK.getStatusCode()); - + getFileDataResponse = UtilIT.getFileData(dataFileId, apiTokenRegular); getFileDataResponse.then().assertThat() .statusCode(BAD_REQUEST.getStatusCode());