DataServiceExecutor { private void setLogLevel( LogLevel logLevel ) { if ( serviceTrans != null ) { serviceTrans.setLogLevel( logLevel ); getServiceTransMeta().setLogLevel( logLevel ); } if ( genTrans != null ) { genTrans.setLogLevel( logLevel ); getGenTransMeta().setLogLevel( logLevel ); } } private  DataServiceExecutor( Builder builder ); static void writeMetadata( DataOutputStream dos, String... metadatas ); DataServiceExecutor executeQuery( final DataOutputStream dos ); DataServiceExecutor executeQuery( Observer<RowMetaAndData> consumer ); DataServiceExecutor executeStreamingQuery( final Observer<List<RowMetaAndData>> streamingConsumer, boolean pollingMode ); String getStreamingGenTransCacheKey(); DataServiceExecutor executeDefaultQuery( final Observer<RowMetaAndData> consumer ); DataServiceExecutor executeQuery(); void executeListeners( ExecutionPoint... stages ); RowProducer addRowProducer(); void waitUntilFinished(); TransMeta getServiceTransMeta(); TransMeta getGenTransMeta(); DataServiceMeta getService(); Trans getServiceTrans(); Trans getGenTrans(); String getServiceName(); Map<String, String> getParameters(); String getId(); Boolean hasErrors(); static String calculateTransname( SQL sql, boolean isService ); void stop( boolean stopTrans ); boolean isStopped(); SQL getSql(); String getResultStepName(); int getRowLimit(); int getServiceRowLimit(); ListMultimap<ExecutionPoint, Runnable> getListenerMap();  }
@Test public void testLogging() throws Exception { when( serviceTrans.getTransMeta() ).thenReturn( transMeta ); TransMeta genTransMeta = mock( TransMeta.class ); when( genTrans.getTransMeta() ).thenReturn( genTransMeta ); new DataServiceExecutor.Builder( new SQL( "SELECT * FROM " + DATA_SERVICE_NAME ), dataService, context ). serviceTrans( serviceTrans ). genTrans( genTrans ). logLevel( LogLevel.DETAILED ). build(); verify( serviceTrans ).setLogLevel( LogLevel.DETAILED ); verify( transMeta ).setLogLevel( LogLevel.DETAILED ); verify( genTrans ).setLogLevel( LogLevel.DETAILED ); verify( genTransMeta ).setLogLevel( LogLevel.DETAILED ); }