sqlWorkspaceRepository.updateUserOnWorkspace(sqlWorkspace, testUser.getUserId(), WorkspaceAccess.WRITE, testUser);
List<WorkspaceUser> workspaceUsers = sqlWorkspaceRepository.findUsersWithAccess(sqlWorkspace.getWorkspaceId(), testUser);
assertTrue(workspaceUsers.size() == 1);
assertEquals(workspaceUsers.get(0).getWorkspaceAccess(), WorkspaceAccess.WRITE);
SqlUser testUser2 = (SqlUser) sqlUserRepository.addUser("456", "qwe", null, "", new String[0]);
sqlWorkspaceRepository.updateUserOnWorkspace(sqlWorkspace, "2", WorkspaceAccess.READ, testUser2);
workspaceUsers = sqlWorkspaceRepository.findUsersWithAccess(sqlWorkspace.getWorkspaceId(), testUser2);
assertTrue(workspaceUsers.size() == 2);
assertEquals(workspaceUsers.get(1).getWorkspaceAccess(), WorkspaceAccess.READ);