@Test(timeout = 60000)
 public void testThatNoTasksAfterEverythingWereExecuted() throws Exception {
   MockTextQuery query = new MockTextQuery();
   executorService.exec(query);
   executorService.shutdown();
   assertEquals(0, this.executorService.countInProgress());
 }
 @Test(timeout = 60000)
 public void testThatRequestWillBeExecuted() throws Exception {
   MockTextQuery query = new MockTextQuery();
   Optional<MockTextProduct> exec = executorService.exec(query);
   assertEquals(new MockTextProduct("_pong", Optional.of(query)), exec.get());
 }
 @Test(timeout = 60000)
 public void testSubmitCounterDecrementsWhenTaskExecuted() throws Exception {
   executorService.exec(new MockTextQuery("ping"));
   assertEquals(0, executorService.countSubmitted());
 }
 @Test(timeout = 60000)
 public void testLifecycleListenersWillGetOnConsumeEvent() throws Exception {
   MockTextQuery query = new MockTextQuery();
   executorService.exec(query);
   assertEquals(1, this.lifecycleListener.requests(MockQueryLifecycleListener.Event.EXEC).count());
 }
 @Test(timeout = 60000)
 public void testThatExecReturnsProductWell() throws Exception {
   MockTextQuery task = new MockTextQuery("ping");
   MockTextProduct product = executorService.exec(task).get();
   assertEquals("ping_pong", product.getResponse());
 }