X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FTestAssurance.java;fp=tests%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FTestAssurance.java;h=3468f1f4c669b014b1847f65ec28173ad11bb837;hb=c0d62ad52b65d78806431b34ed2ae24bf58c1ada;hp=ffc9ea5788fc1f83f04b229572fdf88aad79a6ba;hpb=6c10d13f4178ee1c2be2e669371f0e885661c859;p=gigi.git diff --git a/tests/org/cacert/gigi/pages/wot/TestAssurance.java b/tests/org/cacert/gigi/pages/wot/TestAssurance.java index ffc9ea57..3468f1f4 100644 --- a/tests/org/cacert/gigi/pages/wot/TestAssurance.java +++ b/tests/org/cacert/gigi/pages/wot/TestAssurance.java @@ -107,27 +107,42 @@ public class TestAssurance extends ManagedTest { @Test public void testAssureFormRaceName() throws IOException, SQLException { - testAssureFormRace(true); + testAssureFormRace(true, false); } @Test public void testAssureFormRaceDoB() throws IOException, SQLException { - testAssureFormRace(false); + testAssureFormRace(false, false); } - public void testAssureFormRace(boolean name) throws IOException, SQLException { + @Test + public void testAssureFormRaceNameBlind() throws IOException, SQLException { + testAssureFormRace(true, true); + } + + @Test + public void testAssureFormRaceDoBBlind() throws IOException, SQLException { + testAssureFormRace(false, true); + } + + public void testAssureFormRace(boolean name, boolean succeed) throws IOException, SQLException { URLConnection uc = buildupAssureFormConnection(true); String assureeCookie = login(assureeM, TEST_PASSWORD); - String newName = "lname=" + (name ? "c" : "a") + "&fname=a&mname=&suffix="; - String newDob = "day=1&month=1&year=" + (name ? 1910 : 1911); + String newName = "lname=" + (name && !succeed ? "a" : "c") + "&fname=a&mname=&suffix="; + String newDob = "day=1&month=1&year=" + ( !name && !succeed ? 1911 : 1910); assertNull(executeBasicWebInteraction(assureeCookie, MyDetails.PATH, newName + "&" + newDob + "&processDetails", 0)); uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10").getBytes("UTF-8")); uc.getOutputStream().flush(); String error = fetchStartErrorMessage(IOUtils.readURL(uc)); - assertTrue(error, !error.startsWith("")); + if (succeed) { + assertNull(error); + } else { + assertTrue(error, !error.startsWith("")); + assertThat(error, containsString("changed his personal details")); + } } @Test