X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FTestAssurance.java;h=3ae4ccd4afa204b61a93a514dc4cdb8f6ad4897c;hb=9efe305311c7e9f78a41093d2e2e9c57bfd10c7b;hp=84cd6dc44ae12bfd37890d931572a6bd8a81ce41;hpb=b59c37e88149d0463ab4b802cacb6f0ea883acfb;p=gigi.git diff --git a/tests/org/cacert/gigi/pages/wot/TestAssurance.java b/tests/org/cacert/gigi/pages/wot/TestAssurance.java index 84cd6dc4..3ae4ccd4 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.Country; 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(Country.getCountryByCode("DE", Country.CountryCodeType.CODE_2_CHARS).getName())); } @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(Country.getCountryByCode("DE", Country.CountryCodeType.CODE_2_CHARS).getName())); } 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"); + } + }