- String error = getError("date=2000-01-01&location=testcase&certify=0&rules=1&CCAAgreed=1&assertion=1&points=10");
- assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=&CCAAgreed=1&assertion=1&points=10");
- assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=a&assertion=1&points=10");
- assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=z&points=10");
- assertTrue(error, !error.startsWith("</div>"));
+ executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=0&rules=1&assertion=1&points=10");
+ executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=&assertion=1&points=10");
+ executeFails("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=z&points=10");
+ }
+
+ @Test
+ public void testAssureListingValid() throws IOException, GigiApiException {
+ String uniqueLoc = createUniqueName();
+ execute("date=" + validVerificationDateString() + "&location=" + uniqueLoc + "&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
+
+ String cookie = login(assureeM, TEST_PASSWORD);
+ URLConnection url = get(cookie, Points.PATH);
+ String resp = IOUtils.readURL(url);
+ resp = resp.split(Pattern.quote("</table>"))[1];
+ assertThat(resp, containsString(uniqueLoc));
+ assertThat(resp, containsString(Country.getCountryByCode("DE", Country.CountryCodeType.CODE_2_CHARS).getName()));
+ }
+
+ @Test
+ 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);
+ URLConnection url = get(cookie, Points.PATH);
+ String resp = IOUtils.readURL(url);
+ resp = resp.split(Pattern.quote("</table>"))[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 {
+ assertThat(execute(query), hasError());
+
+ }
+
+ private void executeSuccess(String query) throws MalformedURLException, IOException {
+ assertThat(execute(query), hasNoError());
+