From 907e07d9170b99e38089d794b987c53820cb210a Mon Sep 17 00:00:00 2001 From: Morrten Svanaes Date: Mon, 14 Oct 2024 21:09:21 +0800 Subject: [PATCH] feat: add more validation to file upload (#18112) * feat: add more validation to file upload (cherry picked from commit dcbe1dda45cd39de19bd0163fa831ce032e5a9a8) --- .../dhis/webapi/controller/FileResourceControllerTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/FileResourceControllerTest.java b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/FileResourceControllerTest.java index 19ed902fbc86..b21539852d04 100644 --- a/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/FileResourceControllerTest.java +++ b/dhis-2/dhis-test-web-api/src/test/java/org/hisp/dhis/webapi/controller/FileResourceControllerTest.java @@ -29,12 +29,16 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; import org.hisp.dhis.feedback.ErrorCode; import org.hisp.dhis.jsontree.JsonObject; import org.hisp.dhis.web.HttpStatus; import org.hisp.dhis.webapi.DhisControllerConvenienceTest; import org.hisp.dhis.webapi.json.domain.JsonWebMessage; import org.junit.jupiter.api.Test; +import org.springframework.core.io.ClassPathResource; import org.springframework.mock.web.MockMultipartFile; class FileResourceControllerTest extends DhisControllerConvenienceTest {