DataServiceClient implements IDataServiceClientService { @Override public DataInputStream query( String sqlQuery, final int maxRows ) throws SQLException { return query( sqlQuery, maxRows, ImmutableMap.of() ); } DataServiceClient( Query.Service queryService, DataServiceResolver resolver,
                            ExecutorService executorService ); @Override DataInputStream query( String sqlQuery, final int maxRows ); @Override DataInputStream query( String sqlQuery, final int maxRows,
                                          Map<String, String> params ); @Override DataInputStream query( String sqlQuery, IDataServiceClientService.StreamingMode windowMode,
                                          long windowSize, long windowEvery,
                                          long windowLimit ); @Override DataInputStream query( String sqlQuery, IDataServiceClientService.StreamingMode windowMode,
                                          long windowSize, long windowEvery,
                                          long windowLimit, Map<String, String> params ); Query prepareQuery( String sql, int maxRows, Map<String, String> parameters ); Query prepareQuery( String sql, IDataServiceClientService.StreamingMode windowMode,
                             long windowSize, long windowEvery, long windowLimit, Map<String, String> parameters ); @Override List<IThinServiceInformation> getServiceInformation(); @Override ThinServiceInformation getServiceInformation( String name ); @Override List<String> getServiceNames( String serviceName ); @Override List<String> getServiceNames(); List<DataServiceMeta> getServiceMeta(); DataServiceMeta getServiceMeta( String serviceName ); void setLogChannel( LogChannelInterface log ); LogChannelInterface getLogChannel(); @Deprecated void setRepository( Repository repository ); @Deprecated void setMetaStore( IMetaStore metaStore ); @Override void query( String sqlQuery, IStreamingParams streamParams,
                     Map<String, String> params, Observer<List<RowMetaAndData>> consumer );  }
@Test public void testQuery() throws Exception { when( queryServiceDelegate.prepareQuery( TEST_SQL_QUERY, MAX_ROWS, ImmutableMap.of() ) ) .thenReturn( (MockQuery) outputStream -> new DataOutputStream( outputStream ).writeUTF( QUERY_RESULT ) ); try ( DataInputStream dataInputStream = client.query( TEST_SQL_QUERY, MAX_ROWS ) ) { assertThat( dataInputStream.readUTF(), equalTo( QUERY_RESULT ) ); assertThat( dataInputStream.read(), equalTo( -1 ) ); } verify( queryServiceDelegate ).prepareQuery( TEST_SQL_QUERY, MAX_ROWS, ImmutableMap.of() ); }