DataServiceDialog { protected DataServiceDialog initStreaming( StreamingOverlay streamingOverlay ) throws KettleException { streamingOverlay.apply( this ); XulTabbox optimizationTabs = controller.getElementById( "optimizationTabs" ); if ( optimizationTabs.getTabs().getTabCount() > 0 ) { optimizationTabs.setSelectedIndex( 0 ); } return this; } DataServiceDialog( DataServiceDialogController controller, DataServiceModel model ); XulDomContainer getXulDomContainer(); XulDomContainer applyOverlay( OptimizationOverlay overlay, String xulSource ); void open(); void close(); DataServiceDialogController getController(); DataServiceModel getModel();  }
@Test public void testInitStreaming() throws Exception { XulTabbox tabBox = mock( XulTabbox.class, RETURNS_DEEP_STUBS ); when( controller.getElementById( "optimizationTabs" ) ).thenReturn( tabBox ); when( tabBox.getTabs().getTabCount() ).thenReturn( 2 ); dialog.initStreaming( streamingOverlay ); verify( streamingOverlay ).apply( dialog ); verify( tabBox ).setSelectedIndex( 0 ); reset( tabBox ); when( tabBox.getTabs().getTabCount() ).thenReturn( 0 ); dialog.initStreaming( streamingOverlay ); verify( tabBox, times( 0 ) ).setSelectedIndex( 0 ); }