ServiceCacheOverlay implements DataServiceDialog.OptimizationOverlay { @Override public void apply( DataServiceDialog dialog ) throws KettleException { ServiceCacheController controller = factory.createController(); dialog.applyOverlay( this, XUL_OVERLAY ).addEventHandler( controller ); controller.initBindings( dialog.getModel() ); } ServiceCacheOverlay( ServiceCacheFactory factory ); @Override double getPriority(); @Override void apply( DataServiceDialog dialog );  }
@Test public void testApply() throws Exception { when( factory.createController() ).thenReturn( controller ); when( dialog.applyOverlay( same( overlay ), anyString() ) ).thenReturn( xulDomContainer ); when( dialog.getModel() ).thenReturn( model ); overlay.apply( dialog ); verify( xulDomContainer ).addEventHandler( controller ); verify( controller ).initBindings( model ); }