Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache not updated #42

Open
snfuchs opened this issue Aug 1, 2013 · 0 comments
Open

Cache not updated #42

snfuchs opened this issue Aug 1, 2013 · 0 comments

Comments

@snfuchs
Copy link

snfuchs commented Aug 1, 2013

Seems to me that the cache is not updated, when newer files are available on the server.
To test, I wrote this little test:
public void testServerReturnsDocumentNewerThanCache() throws Exception {
server.enqueue(new MockResponse().setBody("A")
.addHeader("Last-Modified: " + formatDate(-4, TimeUnit.HOURS)));
server.enqueue(new MockResponse().setBody("B")
.addHeader("Last-Modified: " + formatDate(-2, TimeUnit.HOURS)));
server.play();

    URL url = server.getUrl("/");

    assertEquals("A", readAscii(url.openConnection()));
    assertEquals("B", readAscii(url.openConnection()));
}

It fails on the last assert. A is returned instead of B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant