diff --git a/test/net/filebot/web/TMDbClientTest.java b/test/net/filebot/web/TMDbClientTest.java index 09af4fa9..56415002 100644 --- a/test/net/filebot/web/TMDbClientTest.java +++ b/test/net/filebot/web/TMDbClientTest.java @@ -1,17 +1,23 @@ package net.filebot.web; +import static net.filebot.CachedResource.*; import static org.junit.Assert.*; +import java.net.URL; +import java.time.Duration; import java.util.Arrays; import java.util.List; import java.util.Locale; -import net.filebot.web.TMDbClient.Artwork; -import net.filebot.web.TMDbClient.MovieInfo; - import org.junit.Ignore; import org.junit.Test; +import net.filebot.Cache; +import net.filebot.CacheType; +import net.filebot.CachedResource; +import net.filebot.web.TMDbClient.Artwork; +import net.filebot.web.TMDbClient.MovieInfo; + public class TMDbClientTest { TMDbClient tmdb = new TMDbClient("66308fb6e3fd850dde4c7d21df2e8306"); @@ -97,4 +103,13 @@ public class TMDbClientTest { } } + @Ignore + @Test + public void etag() throws Exception { + Cache cache = Cache.getCache("test", CacheType.Persistent); + Cache etagStorage = Cache.getCache("etag", CacheType.Persistent); + CachedResource resource = cache.bytes("http://devel.squid-cache.org/old_projects.html#etag", URL::new).fetch(fetchIfNoneMatch(etagStorage)).expire(Duration.ZERO); + assertArrayEquals(resource.get(), resource.get()); + } + }