public virtual void testNewTaskAssignee() { // given MyResourceAuthorizationProvider.clearProperties(); createGrantAuthorization(TASK, ANY, ALL, userId); string taskId = "myTask"; Task newTask = taskService.newTask(taskId); taskService.saveTask(newTask); // when (1) taskService.setAssignee(taskId, "demo"); // then (1) assertNull(MyResourceAuthorizationProvider.OLD_ASSIGNEE); assertEquals("demo", MyResourceAuthorizationProvider.NEW_ASSIGNEE); MyResourceAuthorizationProvider.clearProperties(); // when (2) taskService.setAssignee(taskId, userId); // then (2) assertEquals("demo", MyResourceAuthorizationProvider.OLD_ASSIGNEE); assertEquals(userId, MyResourceAuthorizationProvider.NEW_ASSIGNEE); taskService.deleteTask(taskId, true); }
public virtual void testAddGroupIdentityLink() { // given MyResourceAuthorizationProvider.clearProperties(); createGrantAuthorization(TASK, ANY, ALL, userId); string taskId = "myTask"; Task newTask = taskService.newTask(taskId); taskService.saveTask(newTask); // when taskService.addGroupIdentityLink(taskId, "management", "myIdentityLink"); // then assertEquals("myIdentityLink", MyResourceAuthorizationProvider.ADD_GROUP_IDENTITY_LINK_TYPE); assertEquals("management", MyResourceAuthorizationProvider.ADD_GROUP_IDENTITY_LINK_GROUP); taskService.deleteTask(taskId, true); }
public virtual void testAddCandidateUser() { // given MyResourceAuthorizationProvider.clearProperties(); createGrantAuthorization(TASK, ANY, ALL, userId); string taskId = "myTask"; Task newTask = taskService.newTask(taskId); taskService.saveTask(newTask); // when taskService.addCandidateUser(taskId, "demo"); // then assertEquals(IdentityLinkType.CANDIDATE, MyResourceAuthorizationProvider.ADD_USER_IDENTITY_LINK_TYPE); assertEquals("demo", MyResourceAuthorizationProvider.ADD_USER_IDENTITY_LINK_USER); taskService.deleteTask(taskId, true); }