@Test
@Deployment(resources = "diagrams/IssueRequestProcess.bpmn")
public void shouldProcessCriticalIssueRequest() throws Exception {
// get a handle on the identity-service
IdentityService identityService = activitiRule.getIdentityService();
// create a new user to create a new request
User requester = identityService.newUser("Micha Kops");
identityService.saveUser(requester);
// create group service and assign the user to it
Group serviceGroup = identityService.newGroup("service");
identityService.saveGroup(serviceGroup);
identityService.createMembership(requester.getId(),
serviceGroup.getId());
// create a new user for an it-support employee
User itguy = identityService.newUser("itguy");
identityService.saveUser(itguy);
// create a group it-support for critical issues
Group itSupportGroup = identityService.newGroup("itsupport-critical");
itSupportGroup.setName("IT Support for Critical Issues");
identityService.saveGroup(itSupportGroup);
// assign the user itguy to the group itsupport-critical
identityService.createMembership(itguy.getId(), itSupportGroup.getId());
// set requester as current user
identityService.setAuthenticatedUserId(requester.getId());
// assert that the process definition does exist in the current
// environment
ProcessDefinition definition = activitiRule.getRepositoryService()
.createProcessDefinitionQuery()