Skip to content

Commit

Permalink
Update WMS cache tests to alter last modified rather than replace fil…
Browse files Browse the repository at this point in the history
…e to test cache
  • Loading branch information
tdrwenski committed Feb 23, 2024
1 parent 4e1c56d commit 60b32c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tds/src/test/java/thredds/server/wms/TestWmsCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 60b32c3

Please sign in to comment.