@Test public void testPagedExecutorCreated() { when(queryRequest.isPaged()).thenReturn(true); when(queryRequest.getSearchText()).thenReturn("(l=TLV)"); QueryRequestExecutor executor = requestExecutorFactory.create(queryRequest); assertTrue(executor instanceof QueryRequestPagedExecutor); }
QueryRequestExecutor create(QueryRequest queryRequest){ QueryRequestExecutor executor; if (!queryRequest.isPaged()) { executor = new QueryRequestNonPagedExecutor(queryRequest); } else { executor = new QueryRequestPagedExecutor(queryRequest); } return executor; }
RequestExecutorFactory { QueryRequestExecutor create(QueryRequest queryRequest){ QueryRequestExecutor executor; if (!queryRequest.isPaged()) { executor = new QueryRequestNonPagedExecutor(queryRequest); } else { executor = new QueryRequestPagedExecutor(queryRequest); } return executor; } }
RequestExecutorFactory { QueryRequestExecutor create(QueryRequest queryRequest){ QueryRequestExecutor executor; if (!queryRequest.isPaged()) { executor = new QueryRequestNonPagedExecutor(queryRequest); } else { executor = new QueryRequestPagedExecutor(queryRequest); } return executor; }  }
RequestExecutorFactory { QueryRequestExecutor create(QueryRequest queryRequest){ QueryRequestExecutor executor; if (!queryRequest.isPaged()) { executor = new QueryRequestNonPagedExecutor(queryRequest); } else { executor = new QueryRequestPagedExecutor(queryRequest); } return executor; }   }
RequestExecutorFactory { QueryRequestExecutor create(QueryRequest queryRequest){ QueryRequestExecutor executor; if (!queryRequest.isPaged()) { executor = new QueryRequestNonPagedExecutor(queryRequest); } else { executor = new QueryRequestPagedExecutor(queryRequest); } return executor; }    }