papiAttributes.setOnSubmit(ON_SUBMIT);
papiAttributes.setOnReset(ON_RESET);
CanvasAttributes attributes = new CanvasAttributes();
EventAttributes events = attributes.getEventAttributes(false);
ScriptAssetReference event = events.getEvent(EventConstants.ON_LOAD);
assertNull(event);
PAPIInternals.initialiseFormEventAttributes(pageContext,
papiAttributes,
attributes);
event = events.getEvent(EventConstants.ON_SUBMIT);
assertNotNull(event);
assertEquals(ON_SUBMIT, event.getScript());
event = events.getEvent(EventConstants.ON_RESET);
assertNotNull(event);
assertEquals(ON_RESET, event.getScript());
// Other events should not have been set.
event = events.getEvent(EventConstants.ON_CLICK);
assertNull(event);
}