papiAttributes.setOnLoad(ON_LOAD);
papiAttributes.setOnUnload(ON_UNLOAD);
CanvasAttributes attributes = new CanvasAttributes();
EventAttributes events = attributes.getEventAttributes(false);
ScriptAssetReference event = events.getEvent(EventConstants.ON_LOAD);
assertNull(event);
PAPIInternals.initialisePageEventAttributes(pageContext,
papiAttributes,
attributes);
event = events.getEvent(EventConstants.ON_LOAD);
assertNotNull(event);
assertEquals(ON_LOAD, event.getScript());
event = events.getEvent(EventConstants.ON_UNLOAD);
assertNotNull(event);
assertEquals(ON_UNLOAD, event.getScript());
// Other events should not have been set.
event = events.getEvent(EventConstants.ON_CLICK);
assertNull(event);
}