@Test public void testRemoveLock() throws Exception { Long objectId = 1L; String objectType = "CASE_FILE"; String lockType = "OBJECT_LOCK"; AcmObjectLock lock = new AcmObjectLock(objectId, objectType); lock.setLockType(lockType); lock.setCreator(authName); expect(acmObjectLockDao.findLock(objectId, objectType)).andReturn(lock); acmObjectLockDao.remove(lock); Capture<AcmObjectUnlockEvent> event = Capture.newInstance(); mockApplicationEventPublisher.publishEvent(capture(event)); replay(mocks); acmObjectLockService.removeLock(objectId, objectType, lockType, authMock); verify(mocks); AcmObjectUnlockEvent captured = event.getValue(); assertEquals(objectId, captured.getParentObjectId()); assertEquals(objectType, captured.getParentObjectType()); assertEquals("OBJECT_LOCK", captured.getObjectType()); }
@Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void removeLock(Long objectId, String objectType, String lockType, String userId) { removeLockInternal(objectId, objectType, lockType, userId); }
AcmObjectLockServiceImpl implements AcmObjectLockService, ApplicationEventPublisherAware { @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void removeLock(Long objectId, String objectType, String lockType, String userId) { removeLockInternal(objectId, objectType, lockType, userId); } }
AcmObjectLockServiceImpl implements AcmObjectLockService, ApplicationEventPublisherAware { @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void removeLock(Long objectId, String objectType, String lockType, String userId) { removeLockInternal(objectId, objectType, lockType, userId); }  }
AcmObjectLockServiceImpl implements AcmObjectLockService, ApplicationEventPublisherAware { @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void removeLock(Long objectId, String objectType, String lockType, String userId) { removeLockInternal(objectId, objectType, lockType, userId); }  @Override AcmObjectLock findLock(Long objectId, String objectType); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Boolean lockInDB, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Boolean lockInDB, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeLock(Long objectId, String objectType, String lockType, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeLock(Long objectId, String objectType, String lockType, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeExpiredLocks(); @Transactional(propagation = Propagation.REQUIRES_NEW) @Override void removeLock(AcmObjectLock objectLock); @Override String getDocumentsWithoutLock(String objectType, Authentication auth, int firstRow, int maxRows, String sort, String fqParams); @Override String getDocumentsWithLock(String objectType, Authentication auth, String lockHeldByUser, int firstRow, int maxRows,
            String sort, String fqParams); @Override String getObjectLocks(String parentObjectType, Authentication auth, String objectId, String creator, int firstRow, int maxRows,
            String sort, String fqParams); void setAcmObjectLockDao(AcmObjectLockDao acmObjectLockDao); ExecuteSolrQuery getExecuteSolrQuery(); void setExecuteSolrQuery(ExecuteSolrQuery executeSolrQuery); ApplicationEventPublisher getApplicationEventPublisher(); @Override void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher); }
AcmObjectLockServiceImpl implements AcmObjectLockService, ApplicationEventPublisherAware { @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void removeLock(Long objectId, String objectType, String lockType, String userId) { removeLockInternal(objectId, objectType, lockType, userId); }  @Override AcmObjectLock findLock(Long objectId, String objectType); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Boolean lockInDB, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) AcmObjectLock createLock(Long objectId, String objectType, String lockType, Long expiry, Boolean lockInDB, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeLock(Long objectId, String objectType, String lockType, String userId); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeLock(Long objectId, String objectType, String lockType, Authentication auth); @Override @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) void removeExpiredLocks(); @Transactional(propagation = Propagation.REQUIRES_NEW) @Override void removeLock(AcmObjectLock objectLock); @Override String getDocumentsWithoutLock(String objectType, Authentication auth, int firstRow, int maxRows, String sort, String fqParams); @Override String getDocumentsWithLock(String objectType, Authentication auth, String lockHeldByUser, int firstRow, int maxRows,
            String sort, String fqParams); @Override String getObjectLocks(String parentObjectType, Authentication auth, String objectId, String creator, int firstRow, int maxRows,
            String sort, String fqParams); void setAcmObjectLockDao(AcmObjectLockDao acmObjectLockDao); ExecuteSolrQuery getExecuteSolrQuery(); void setExecuteSolrQuery(ExecuteSolrQuery executeSolrQuery); ApplicationEventPublisher getApplicationEventPublisher(); @Override void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher);  }