DualQueryService implements Query.Service { @Override public Query prepareQuery( String sqlString, int maxRows, Map<String, String> parameters ) { return prepareQuery( sqlString, null, 0, 0, 0, parameters ); } DualQueryService(); @Override Query prepareQuery( String sqlString, int maxRows, Map<String, String> parameters ); @Override Query prepareQuery( String sqlString, IDataServiceClientService.StreamingMode windowMode,
                                       long windowSize, long windowEvery, long windowLimit,
                                       final Map<String, String> parameters ); static final String DUMMY_TABLE_NAME; }
@Test public void testWriteDummyRow() throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); dualQueryService.prepareQuery( TEST_DUMMY_SQL_QUERY, -1, ImmutableMap.<String, String>of() ).writeTo( byteArrayOutputStream ); byte[] data = byteArrayOutputStream.toByteArray(); assertThat( ByteStreams.newDataInput( data ).readUTF(), equalTo( DUAL_TABLE_NAME ) ); assertThat( data, equalTo( DualQueryService.DATA ) ); }