use of play.mvc.Http.Response in project play-cookbook by spinscale.
the class UserRightTest method login.
private void login(String user, String pass) {
String data = "username=" + user + "&password=" + pass;
Response response = POST("/login", APPLICATION_X_WWW_FORM_URLENCODED, data);
assertIsOk(response);
}
use of play.mvc.Http.Response in project play-cookbook by spinscale.
the class UserRightTest method testSecretsAreDeniedForUnknownUser.
@Test
public void testSecretsAreDeniedForUnknownUser() {
Response response = GET("/secret");
assertStatus(404, response);
}
use of play.mvc.Http.Response in project play-cookbook by spinscale.
the class CachingTest method testThatCachingPagePartsWork.
@Test
public void testThatCachingPagePartsWork() {
Response response = GET("/");
String cachedTime = getCachedTime(response);
assertEquals(getUncachedTime(response), cachedTime);
response = GET("/");
String newCachedTime = getCachedTime(response);
assertNotSame(getUncachedTime(response), newCachedTime);
assertEquals(cachedTime, newCachedTime);
}
use of play.mvc.Http.Response in project play-cookbook by spinscale.
the class CachingTest method testThatCachingHeadersAreSet.
@Test
public void testThatCachingHeadersAreSet() {
Response response = GET("/proxyCache");
assertIsOk(response);
assertHeaderEquals("Cache-Control", "max-age=3600", response);
}
use of play.mvc.Http.Response in project play-cookbook by spinscale.
the class FeedTest method testThatAtomWorks.
@Test
public void testThatAtomWorks() throws Exception {
Response response = GET("/feed/posts.atom");
assertIsOk(response);
assertContentType("application/atom+xml", response);
assertCharset("utf-8", response);
SyndFeed feed = getFeed(response);
assertEquals("atom_0.3", feed.getFeedType());
}
Aggregations