From 60b32c31b850d6d232648acc1e9e075cce3d49e1 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Fri, 23 Feb 2024 11:53:56 -0700 Subject: [PATCH] Update WMS cache tests to alter last modified rather than replace file to test cache --- tds/src/test/java/thredds/server/wms/TestWmsCache.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tds/src/test/java/thredds/server/wms/TestWmsCache.java b/tds/src/test/java/thredds/server/wms/TestWmsCache.java index 031fa07b61..3e76da989c 100644 --- a/tds/src/test/java/thredds/server/wms/TestWmsCache.java +++ b/tds/src/test/java/thredds/server/wms/TestWmsCache.java @@ -12,6 +12,7 @@ import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; +import org.joda.time.DateTime; import org.junit.*; import org.junit.experimental.categories.Category; import org.junit.rules.TemporaryFolder; @@ -161,8 +162,9 @@ public void shouldNotLockFileInCacheAfterExceptionIsThrown() throws ServletExcep assertWithMessage(cache.showCache().toString()).that(isLocked).isFalse(); } - private void updateTestFile() throws IOException { - Files.copy(TEST_FILE, TEMP_FILE, StandardCopyOption.REPLACE_EXISTING); + private void updateTestFile() { + final File testFile = new File(TEMP_FILE.toUri()); + assertThat(testFile.setLastModified(DateTime.now().getMillis())).isTrue(); } private void assertUsedCache(String path) throws ServletException, IOException {