From: Felix Dörre Date: Sun, 21 Sep 2014 13:54:08 +0000 (+0200) Subject: ADD: basic TTP-application-tests. X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=846ad43e2138f9f8d400ad9a6ba485dd8e2fd0b3;ds=sidebyside ADD: basic TTP-application-tests. --- 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("