* @throws DuplicateResourceNameException
* @throws NoPermissionException
*/
@Test
public void updateResourceWithDataAccessException() throws DuplicateResourceNameException, NoPermissionException {
Resource resource = getDefaultResource();
expect(resourceDatabase.getResourceById(resource.getResourceId())).andReturn(resource);
policyService.checkPermission(resourceType, PolicyConstants.PERM_EDIT_AND_ASSIGN, (SessionInfo) null);
resourceDatabase.updateResource(resource);
expectLastCall().andThrow(new DataAccessException("Failed to update resource."));
CoreEvent changeEvent = getChangeEvent(resourceService.getEditEventId(), CoreEvent.STATE_UNSUCCESSFUL);
coreEventService.fireCoreEvent(eqCoreEvent(changeEvent));