DataServiceDialog { public XulDomContainer applyOverlay( OptimizationOverlay overlay, String xulSource ) throws KettleException { XulDomContainer xulDomContainer = getXulDomContainer(); try { xulDomContainer.loadOverlay( xulSource, createResourceBundle( overlay.getClass() ) ); } catch ( XulException e ) { throw new KettleException( e ); } return xulDomContainer; } DataServiceDialog( DataServiceDialogController controller, DataServiceModel model ); XulDomContainer getXulDomContainer(); XulDomContainer applyOverlay( OptimizationOverlay overlay, String xulSource ); void open(); void close(); DataServiceDialogController getController(); DataServiceModel getModel();  }
@Test public void testApplyOverlay() throws Exception { final DataServiceDialog.OptimizationOverlay overlay = mock( DataServiceDialog.OptimizationOverlay.class ); final ResourceBundle resourceBundle = mock( ResourceBundle.class ); String xulOverlay = "/path/to/overlay.xul"; dialog = new DataServiceDialog( controller, model ) { @Override protected ResourceBundle createResourceBundle( Class<?> packageClass ) { assertThat( packageClass, equalTo( (Class) overlay.getClass() ) ); assertThat( super.createResourceBundle( packageClass ), isA( ResourceBundle.class ) ); return resourceBundle; } }; dialog.applyOverlay( overlay, xulOverlay ); verify( xulDomContainer ).loadOverlay( xulOverlay, resourceBundle ); }