From c9c17dd8ea5cceea9c5af7ad6d1508dad256e21f Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Fri, 20 Sep 2024 01:03:26 -0300 Subject: [PATCH] Fix tmp dir location in test --- .../jdbcconfig/JDBCConfigAutoConfigurationTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfigurationTest.java b/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfigurationTest.java index d72e35f5e..f8ad73048 100644 --- a/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfigurationTest.java +++ b/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfigurationTest.java @@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.nio.file.Paths; + /** * Test {@link JDBCConfigBackendConfigurer} through {@link JDBCConfigAutoConfiguration} when {@code * geoserver.backend.jdbcconfig.enabled=true} @@ -49,8 +51,9 @@ void testProperties() { assertNotNull(configProperties); assertNotNull(configProperties.getDatasource()); assertNotNull(configProperties.getCacheDirectory()); - assertEquals( - "/tmp/geoserver-jdbcconfig-cache", configProperties.getCacheDirectory().toString()); + var tmp = Paths.get(System.getProperty("java.io.tmpdir")); + var expected = tmp.resolve("geoserver-jdbcconfig-cache"); + assertEquals(expected.toString(), configProperties.getCacheDirectory().toString()); } @Test