Merge branch '3.2.x' into 3.3.x

Closes gh-41907
This commit is contained in:
Andy Wilkinson 2024-08-16 19:47:37 +01:00
commit cca5516ab0
1 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,8 @@
package org.springframework.boot.logging;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
@ -43,8 +45,10 @@ public abstract class AbstractLoggingSystemTests {
private String originalTempDirectory;
@BeforeEach
void configureTempDir(@TempDir Path temp) {
void configureTempDir(@TempDir Path temp) throws IOException {
this.originalTempDirectory = System.getProperty(JAVA_IO_TMPDIR);
Files.delete(Files.createTempFile("prevent", "pollution"));
File.createTempFile("prevent", "pollution").delete();
System.setProperty(JAVA_IO_TMPDIR, temp.toAbsolutePath().toString());
MDC.clear();
}