* The ComponentInvocation object corresponding to the action link.
* @return The DOM created. Typically you will assert against it.
*/
public Document invoke(ComponentInvocation invocation)
{
ActionResponseGenerator generator = click(invocation);
if (generator instanceof LinkActionResponseGenerator)
{
LinkActionResponseGenerator linkGenerator = (LinkActionResponseGenerator) generator;
Link link = linkGenerator.getLink();
ComponentInvocation followup = _componentInvocationMap.get(link);
return _followupInvoker.invoke(followup);
}
String message = String
.format(
"ActionResponseGenerator %s is an instance of class %s, which is not compatible with PageTester.",
generator,
generator.getClass());
throw new RuntimeException(message);
}