You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by cw...@apache.org on 2022/09/14 03:50:02 UTC

[druid] branch master updated: fix JsonParserIteratorTest (#13083)

This is an automated email from the ASF dual-hosted git repository.

cwylie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new f4ec50bf7a fix JsonParserIteratorTest (#13083)
f4ec50bf7a is described below

commit f4ec50bf7a9e7e423dad4b1c2fb3c5af846ef075
Author: Clint Wylie <cw...@apache.org>
AuthorDate: Tue Sep 13 20:49:57 2022 -0700

    fix JsonParserIteratorTest (#13083)
---
 .../java/org/apache/druid/client/JsonParserIteratorTest.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java b/server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
index 472fa6c96f..bd39d8f6ad 100644
--- a/server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
+++ b/server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
@@ -30,6 +30,7 @@ import org.apache.druid.java.util.common.StringUtils;
 import org.apache.druid.java.util.common.concurrent.Execs;
 import org.apache.druid.query.Query;
 import org.apache.druid.query.QueryCapacityExceededException;
+import org.apache.druid.query.QueryContext;
 import org.apache.druid.query.QueryException;
 import org.apache.druid.query.QueryInterruptedException;
 import org.apache.druid.query.QueryTimeoutException;
@@ -306,10 +307,15 @@ public class JsonParserIteratorTest
     private Query<?> mockQuery(String queryId, long timeoutAt)
     {
       Query<?> query = Mockito.mock(Query.class);
+      QueryContext context = Mockito.mock(QueryContext.class);
       Mockito.when(query.getId()).thenReturn(queryId);
-      Mockito.when(query.getQueryContext().getAsLong(ArgumentMatchers.eq(DirectDruidClient.QUERY_FAIL_TIME),
-                                                     ArgumentMatchers.eq(-1L)))
-             .thenReturn(timeoutAt);
+      Mockito.when(query.getQueryContext()).thenReturn(context);
+      Mockito.when(
+          context.getAsLong(
+              ArgumentMatchers.eq(DirectDruidClient.QUERY_FAIL_TIME),
+              ArgumentMatchers.eq(-1L)
+          )
+      ).thenReturn(timeoutAt);
       return query;
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org