Verify ETag handling works (even if it doesn't on TMDB servers at this point)

This commit is contained in:
Reinhard Pointner 2016-03-11 21:26:36 +00:00
parent ae8ca2eeb3
commit 730866f880
1 changed files with 18 additions and 3 deletions

View File

@ -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<String, byte[]> 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());
}
}