1 package net.pterodactylus.sone.web;
3 import static org.hamcrest.MatcherAssert.assertThat;
4 import static org.hamcrest.Matchers.is;
9 * Unit test for {@link AboutPage}.
11 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
13 public class AboutPageTest extends WebPageTest {
15 private final String version = "0.1.2";
16 private final int year = 1234;
17 private final String homepage = "home://page";
18 private final AboutPage page = new AboutPage(template, webInterface, version, year, homepage);
21 public void pageReturnsCorrectPath() {
22 assertThat(page.getPath(), is("about.html"));
26 public void pageSetsCorrectVersionInTemplateContext() throws Exception {
27 page.processTemplate(freenetRequest, templateContext);
28 assertThat(templateContext.get("version"), is((Object) version));
32 public void pageSetsCorrectHomepageInTemplateContext() throws Exception {
33 page.processTemplate(freenetRequest, templateContext);
34 assertThat(templateContext.get("homepage"), is((Object) homepage));
38 public void pageSetsCorrectYearInTemplateContext() throws Exception {
39 page.processTemplate(freenetRequest, templateContext);
40 assertThat(templateContext.get("year"), is((Object) year));