1 package club.wpia.gigi.pages.account;
3 import static org.hamcrest.CoreMatchers.*;
4 import static org.hamcrest.MatcherAssert.*;
6 import java.io.IOException;
7 import java.security.GeneralSecurityException;
10 import org.junit.Test;
12 import club.wpia.gigi.dbObjects.CATS;
13 import club.wpia.gigi.dbObjects.CATS.CATSType;
14 import club.wpia.gigi.pages.account.UserTrainings;
15 import club.wpia.gigi.testUtils.ClientTest;
16 import club.wpia.gigi.testUtils.IOUtils;
17 import club.wpia.gigi.util.HTMLEncoder;
19 public class TestTrainings extends ClientTest {
21 public TestTrainings() throws GeneralSecurityException, IOException {}
24 public void testShow() throws IOException, GeneralSecurityException {
25 CATS.enterResult(u, CATSType.AGENT_CHALLENGE, new Date(System.currentTimeMillis()), "en_US", "1");
26 CATS.enterResult(u, "Special Case Test", new Date(System.currentTimeMillis()), "spLan", "v23");
27 String res = IOUtils.readURL(get(UserTrainings.PATH));
28 assertThat(res, containsString("Special Case Test"));
29 assertThat(res, containsString(HTMLEncoder.encodeHTML(CATSType.AGENT_CHALLENGE.getDisplayName())));
30 assertThat(res, containsString("en_US, 1"));
31 assertThat(res, containsString("v23"));
32 assertThat(res, containsString("spLan"));