55
55
import static com .github .dreamhead .moco .Moco .and ;
56
56
import static com .github .dreamhead .moco .Moco .by ;
57
57
import static com .github .dreamhead .moco .Moco .eq ;
58
+ import static com .github .dreamhead .moco .Moco .exist ;
58
59
import static com .github .dreamhead .moco .Moco .httpServer ;
59
60
import static com .github .dreamhead .moco .Moco .query ;
60
61
import static com .github .dreamhead .moco .Moco .status ;
@@ -76,6 +77,7 @@ public class EventRecorderTest {
76
77
private static final String COLLECT_SUCCESS = "/collect/success" ;
77
78
private static final String COLLECT_FAIL = "/collect/fail" ;
78
79
private static final String COLLECT_FOR_VERIFY_HASH_CODE = "/collect/hashcode" ;
80
+ private static final String COLLECT_FOR_VERIFY_UPLOAD_TIMESTAMP = "/collect/timestamp" ;
79
81
private static Runner runner ;
80
82
private static String jsonString ;
81
83
private static HttpServer server ;
@@ -553,6 +555,21 @@ public void testRecordEventRequestWithHashCode() throws Exception {
553
555
assertTrue (requestResult );
554
556
}
555
557
558
+ /**
559
+ * test record event with request parameter upload timestamp.
560
+ *
561
+ * @throws Exception exception.
562
+ */
563
+ @ Test
564
+ public void testRecordEventRequestUploadTimestamp () throws Exception {
565
+ setRequestPath (COLLECT_FOR_VERIFY_UPLOAD_TIMESTAMP );
566
+ server .request (
567
+ and (by (uri (COLLECT_FOR_VERIFY_UPLOAD_TIMESTAMP )), exist (query ("upload_timestamp" ))))
568
+ .response (status (200 ), text ("success" ));
569
+ boolean requestResult = NetRequest .uploadEvents ("[]" , clickstreamContext .getClickstreamConfiguration (), 1 );
570
+ assertTrue (requestResult );
571
+ }
572
+
556
573
/**
557
574
* common method to set request path.
558
575
*
0 commit comments