### Question:
CommonsQueryEngine implements IQueryEngine { @Override public final void pagedExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler, int pageSize) throws ConnectorException { Long time = null; try { for (LogicalStep project : workflow.getInitialSteps()) { ClusterName clusterName = ((Project) project).getClusterName(); connectionHandler.startJob(clusterName.getName()); } if (logger.isDebugEnabled()) { logger.debug("Async paged Executing [" + workflow.toString() + "] : queryId [" + queryId + "]"); } time = System.currentTimeMillis(); pagedExecuteWorkFlow(queryId, workflow, resultHandler, pageSize); if (logger.isDebugEnabled()) { logger.debug( "The async query [" + queryId + "] has ended"); } } finally { for (LogicalStep project : workflow.getInitialSteps()) { connectionHandler.endJob(((Project) project).getClusterName().getName()); } if (time != null) { logger.info("TIME - The execute time to paged executed with queryId [" + queryId + "] has been [" + (System .currentTimeMillis() - time) + "]"); } } } protected  CommonsQueryEngine(ConnectionHandler connectionHandler); @Override final void asyncExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler); @Override final void pagedExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler,
                                   int pageSize); @Override final QueryResult execute(String queryId, LogicalWorkflow workflow);  }### Answer:
@Test public void testpagedExecuteWorkFlowLog() throws ConnectorException { Logger logger = mock(Logger.class); Whitebox.setInternalState(commonsQueryEngineStub, "logger", logger); when(logger.isDebugEnabled()).thenReturn(true); String queryID = "queryID"; LogicalWorkflow logicalworkFlow = mock(LogicalWorkflow.class); IResultHandler resultHandler = mock(IResultHandler.class); commonsQueryEngineStub.pagedExecute(queryID, logicalworkFlow, resultHandler, 10); verify(logger).debug("Async paged Executing [" + logicalworkFlow.toString() + "] : queryId [" + queryID + "]"); verify(logger).debug("The async query [" + queryID + "] has ended"); }