@@ -62,6 +62,18 @@ public void testEventsFromJob() {
6262 job .cancel ();
6363 }
6464
65+ @ Test
66+ public void testEventsWithSearchParams () {
67+ Job job = jobs .create (QUERY );
68+ waitUntilDone (job );
69+
70+ Map args = new HashMap <String , Object >();
71+ args .put ("search" ,"| head 1" );
72+ Assert .assertEquals (1 , countEvents (job .getEvents (args )));
73+
74+ job .cancel ();
75+ }
76+
6577 @ Test
6678 public void testResultsFromJob () {
6779 Job job = jobs .create (QUERY );
@@ -71,6 +83,18 @@ public void testResultsFromJob() {
7183
7284 job .cancel ();
7385 }
86+
87+ @ Test
88+ public void testResultsWithSearchParams () {
89+ Job job = jobs .create (QUERY );
90+ waitUntilDone (job );
91+
92+ Map args = new HashMap <String , Object >();
93+ args .put ("search" ,"| head 1" );
94+ Assert .assertEquals (1 , countEvents (job .getResults (args )));
95+
96+ job .cancel ();
97+ }
7498
7599 @ Test
76100 public void testGetJobBySid () {
@@ -584,6 +608,26 @@ public void testPreview() throws InterruptedException {
584608 job .cancel ();
585609 }
586610
611+ @ Test
612+ public void testPreviewWithSearchParams () throws InterruptedException {
613+ JobArgs args = new JobArgs ();
614+ args .put ("field_list" , "source,host,sourcetype" );
615+ args .setStatusBuckets (100 );
616+
617+ Job job = jobs .create (QUERY , args );
618+
619+ while (!job .isReady ()) {
620+ Thread .sleep (100 );
621+ }
622+
623+ Map argsSearchQuery = new HashMap <String , Object >();
624+ argsSearchQuery .put ("search" ,"| head 1" );
625+ // Assert.assertTrue(1 >= countEvents(job.getResultsPreview(args)));
626+ Assert .assertEquals (1 , countEvents (job .getResultsPreview (argsSearchQuery )));
627+
628+ job .cancel ();
629+ }
630+
587631 @ Test
588632 public void testSearchLog () {
589633 Job job = jobs .create (QUERY );
0 commit comments