X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FTestAssurance.java;h=b950389b07c9922c16667496fa815f2f78920ebb;hp=84cd6dc44ae12bfd37890d931572a6bd8a81ce41;hb=2a62920f111cb873e4b67ca57449f95e654a96e2;hpb=b59c37e88149d0463ab4b802cacb6f0ea883acfb diff --git a/tests/org/cacert/gigi/pages/wot/TestAssurance.java b/tests/org/cacert/gigi/pages/wot/TestAssurance.java index 84cd6dc4..b950389b 100644 --- a/tests/org/cacert/gigi/pages/wot/TestAssurance.java +++ b/tests/org/cacert/gigi/pages/wot/TestAssurance.java @@ -16,7 +16,9 @@ import java.util.Calendar; import java.util.Date; import java.util.regex.Pattern; +import org.cacert.gigi.GigiApiException; import org.cacert.gigi.database.GigiPreparedStatement; +import org.cacert.gigi.dbObjects.CountryCode; import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.pages.account.MyDetails; import org.cacert.gigi.testUtils.IOUtils; @@ -225,7 +227,7 @@ public class TestAssurance extends ManagedTest { } @Test - public void testAssureListingValid() throws IOException { + public void testAssureListingValid() throws IOException, GigiApiException { String uniqueLoc = createUniqueName(); execute("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); @@ -234,10 +236,11 @@ public class TestAssurance extends ManagedTest { String resp = IOUtils.readURL(url); resp = resp.split(Pattern.quote(""))[1]; assertThat(resp, containsString(uniqueLoc)); + assertThat(resp, containsString(CountryCode.getCountryCode("DE", CountryCode.CountryCodeType.CODE_2_CHARS).getCountry())); } @Test - public void testAssurerListingValid() throws IOException { + public void testAssurerListingValid() throws IOException, GigiApiException { String uniqueLoc = createUniqueName(); executeSuccess("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); String cookie = login(assurerM, TEST_PASSWORD); @@ -245,6 +248,7 @@ public class TestAssurance extends ManagedTest { String resp = IOUtils.readURL(url); resp = resp.split(Pattern.quote(""))[2]; assertThat(resp, containsString(uniqueLoc)); + assertThat(resp, containsString(CountryCode.getCountryCode("DE", CountryCode.CountryCodeType.CODE_2_CHARS).getCountry())); } private void executeFails(String query) throws MalformedURLException, IOException { @@ -313,4 +317,10 @@ public class TestAssurance extends ManagedTest { assertThat(IOUtils.readURL(uc), hasError()); } + + @Test + public void testAssureFormNoCountry() throws IOException { + executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=&certify=1&rules=1&assertion=1&points=10"); + } + }