Fix unit tests

This commit is contained in:
Paulo Gustavo Veiga
2022-03-23 10:56:57 -03:00
parent 63f83e879d
commit b8eadb7533
9 changed files with 144 additions and 113 deletions

View File

@@ -110,9 +110,10 @@ class LockManagerImpl implements LockManager {
}
@NotNull
private LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user, long session) throws LockException {
@Override
public LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user, long session) throws LockException {
if (isLocked(mindmap) && !isLockedBy(mindmap, user)) {
throw new LockException("Invalid lock, this should not happen");
throw LockException.createLockLost(mindmap, user, this);
}
LockInfo result = lockInfoByMapId.get(mindmap.getId());