mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-09-13 20:25:28 +02:00
refactor: replace legacy Paths usage with Path.of (#6441)
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ package stirling.software.SPDF.controller.api.misc;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -34,9 +34,9 @@ class PrintFileControllerTest {
|
||||
@Test
|
||||
void printFile_absolutePath_throwsException() {
|
||||
PrintFileRequest request = new PrintFileRequest();
|
||||
String absPath = Paths.get("/etc/passwd").toString();
|
||||
String absPath = Path.of("/etc/passwd").toString();
|
||||
// Only test on systems where /etc/passwd is absolute
|
||||
if (Paths.get(absPath).isAbsolute()) {
|
||||
if (Path.of(absPath).isAbsolute()) {
|
||||
MockMultipartFile file =
|
||||
new MockMultipartFile(
|
||||
"fileInput", absPath, "application/pdf", "data".getBytes());
|
||||
|
||||
Reference in New Issue
Block a user