]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/pages/wot/TestAssurance.java
fix: allow assurance in +12 hours (due to date/timezone issues)
[gigi.git] / tests / org / cacert / gigi / pages / wot / TestAssurance.java
index 134f7427faaf6dd826a4546a6bba0266ee9b5aab..b6396a17c900d188239f509ce01b0e1b8fd1643b 100644 (file)
@@ -12,6 +12,7 @@ import java.net.URLConnection;
 import java.net.URLEncoder;
 import java.sql.SQLException;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.regex.Pattern;
 
@@ -140,6 +141,17 @@ public class TestAssurance extends ManagedTest {
         assertTrue(error, !error.startsWith("</div>"));
     }
 
+    @Test
+    public void testAssureFormFutureOK() throws IOException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.setTimeInMillis(System.currentTimeMillis());
+        c.add(Calendar.HOUR_OF_DAY, 12);
+
+        String error = getError("date=" + sdf.format(new Date(c.getTimeInMillis())) + "&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+        assertNull(error);
+    }
+
     @Test
     public void testAssureFormNoLoc() throws IOException {
         String error = getError("date=2000-01-01&location=a&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");