  @Test
  public void testExecutorQueryInnerClass() throws Exception {

    SQL sql = new SQL( "select field from table" );
    ExecutorQueryService executorQueryService = new ExecutorQueryService( dataServiceResolver, metastoreLocator );
    Query executorQuery = executorQueryService.prepareQuery( sql.getSqlString(), rowLimit, parameters );

    DataOutputStream dataOutputStreamMock = mock( DataOutputStream.class );
    doReturn( dataServiceExecutor ).when( dataServiceExecutor ).executeQuery( dataOutputStreamMock );
    executorQuery.writeTo( dataOutputStreamMock );
    verify( dataServiceExecutor, times( 1 ) ).waitUntilFinished();
  }