Description
Class org.apache.wicket.markup.html.panel.Fragment has two attributes: "associated markupId" and "markupProvider". One can reach "markupProvider" with "getMarkupProvider", but there's no way to reach "markupId" (not even extending Fragment, since the attribute is private). IMHO, two actions must be taken:
1. rename this attribute to "associatedMarkupId", to prevent name clash from parent's "getMarkupId";
2. create a "getAssociatedMarkupId"
This is a must have for unit testing. Consider a classic "view/edit" pair of fragments (where "view" appears for guests and "edit" for admins). I could test if "view" is activated as simple as:
tester.assertComponent("panel:grid", Fragment.class);
assertEquals("view", ((Fragment) tester.getComponentFromLastRenderedPage("panel:grid")).getAssociatedMarkupId());
Unfortunatelly, there's no way to get the associated markup id. This means this behavior is untestable!