From 846ad43e2138f9f8d400ad9a6ba485dd8e2fd0b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Sun, 21 Sep 2014 15:54:08 +0200 Subject: [PATCH] ADD: basic TTP-application-tests. --- tests/org/cacert/gigi/pages/wot/TestTTP.java | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/org/cacert/gigi/pages/wot/TestTTP.java diff --git a/tests/org/cacert/gigi/pages/wot/TestTTP.java b/tests/org/cacert/gigi/pages/wot/TestTTP.java new file mode 100644 index 00000000..f1180800 --- /dev/null +++ b/tests/org/cacert/gigi/pages/wot/TestTTP.java @@ -0,0 +1,48 @@ +package org.cacert.gigi.pages.wot; + +import java.io.IOException; +import java.net.URL; + +import org.cacert.gigi.GigiApiException; +import org.cacert.gigi.dbObjects.Group; +import org.cacert.gigi.dbObjects.ObjectCache; +import org.cacert.gigi.dbObjects.User; +import org.cacert.gigi.testUtils.IOUtils; +import org.cacert.gigi.testUtils.ManagedTest; +import org.junit.Test; + +import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.*; + +public class TestTTP extends ManagedTest { + + User u = User.getById(createVerifiedUser("fn", "ln", "test-" + createUniqueName() + "@example.org", TEST_PASSWORD)); + + String cookie = login(u.getEmail(), TEST_PASSWORD); + + URL ttpPage = new URL("https://" + getServerName() + RequestTTPPage.PATH); + + public TestTTP() throws IOException {} + + @Test + public void testTTPApply() throws IOException { + String ttp = IOUtils.readURL(cookie(ttpPage.openConnection(), cookie)); + assertThat(ttp, containsString("