Commit 2a1b1db8 authored by Kevin Smith's avatar Kevin Smith Committed by Andrea Aime
Browse files

GEOS-7203, Unit test should simulate AJAX and then run validators

parent 50fbdb1c
......@@ -184,16 +184,25 @@ public class LayerCacheOptionsTabPanelTest extends GeoServerWicketTestSupport {
}));
tester.assertComponent("form:panel", LayerCacheOptionsTabPanel.class);
tester.isVisible("form:panel:tileLayerEditor:container:configs");
// Avoid saving the Layer
FormTester formTester = tester.newFormTester("form");
formTester.setValue("panel:tileLayerEditor:createTileLayer", false);
formTester.submit();
tester.executeAjaxEvent("form:panel:tileLayerEditor:createTileLayer", "onchange");
tester.isInvisible("form:panel:tileLayerEditor:container:configs");
LayerCacheOptionsTabPanel panel = (LayerCacheOptionsTabPanel) tester
.getComponentFromLastRenderedPage("form:panel");
formTester.getForm().onFormSubmitted(); // This is an utter hack but is the only way I could
// figure out to exercise the validators the same
// way that happens in a live GeoServer
panel.save();
// Ensure the GeoServerTileLayerInfoModel is updated
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment