1 package org.cacert.gigi.pages.admin;
3 import static org.hamcrest.CoreMatchers.*;
4 import static org.junit.Assert.*;
6 import java.io.IOException;
7 import java.net.MalformedURLException;
9 import java.net.URLConnection;
11 import org.cacert.gigi.dbObjects.Group;
12 import org.cacert.gigi.pages.admin.support.SupportUserDetailsPage;
13 import org.cacert.gigi.testUtils.ClientTest;
14 import org.cacert.gigi.testUtils.IOUtils;
15 import org.junit.Test;
17 public class TestSEAdminPageDetails extends ClientTest {
19 public TestSEAdminPageDetails() throws IOException {
20 grant(email, Group.SUPPORTER);
24 public void testUserDetailsDisplay() throws MalformedURLException, IOException {
25 String email = createUniqueName() + "@example.com";
26 String fname = "Först";
27 String lname = "Secönd";
28 int id = createVerifiedUser(fname, lname, email, TEST_PASSWORD);
29 URLConnection uc = new URL("https://" + getServerName() + SupportUserDetailsPage.PATH + id).openConnection();
30 uc.addRequestProperty("Cookie", cookie);
32 String res = IOUtils.readURL(uc);
33 assertThat(res, containsString("<input type=\"text\" value=\"" + fname + "\" name=\"fname\">"));
34 assertThat(res, containsString("<input type=\"text\" value=\"" + lname + "\" name=\"lname\">"));
35 assertThat(res, containsString(email));