5555import static com .github .dreamhead .moco .Moco .and ;
5656import static com .github .dreamhead .moco .Moco .by ;
5757import static com .github .dreamhead .moco .Moco .eq ;
58+ import static com .github .dreamhead .moco .Moco .exist ;
5859import static com .github .dreamhead .moco .Moco .httpServer ;
5960import static com .github .dreamhead .moco .Moco .query ;
6061import static com .github .dreamhead .moco .Moco .status ;
@@ -76,6 +77,7 @@ public class EventRecorderTest {
7677 private static final String COLLECT_SUCCESS = "/collect/success" ;
7778 private static final String COLLECT_FAIL = "/collect/fail" ;
7879 private static final String COLLECT_FOR_VERIFY_HASH_CODE = "/collect/hashcode" ;
80+ private static final String COLLECT_FOR_VERIFY_UPLOAD_TIMESTAMP = "/collect/timestamp" ;
7981 private static Runner runner ;
8082 private static String jsonString ;
8183 private static HttpServer server ;
@@ -553,6 +555,21 @@ public void testRecordEventRequestWithHashCode() throws Exception {
553555 assertTrue (requestResult );
554556 }
555557
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+
556573 /**
557574 * common method to set request path.
558575 *
0 commit comments