assertEquals(1, identityLinks.size());
if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
List<Event> processInstanceEvents = runtimeService.getProcessInstanceEvents(processInstanceId);
assertEquals(1, processInstanceEvents.size());
Event processIsntanceEvent = processInstanceEvents.get(0);
assertEquals(Event.ACTION_ADD_GROUP_LINK, processIsntanceEvent.getAction());
List<String> processInstanceEventMessageParts = processIsntanceEvent.getMessageParts();
assertEquals("muppets", processInstanceEventMessageParts.get(0));
assertEquals(IdentityLinkType.PARTICIPANT, processInstanceEventMessageParts.get(1));
assertEquals(2, processInstanceEventMessageParts.size());
}
runtimeService.deleteParticipantGroup(processInstanceId, "muppets");
if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
List<Event> processInstanceEvents = runtimeService.getProcessInstanceEvents(processInstanceId);
Event processIsntanceEvent = findProcessInstanceEvent(processInstanceEvents, Event.ACTION_DELETE_GROUP_LINK);
assertEquals(Event.ACTION_DELETE_GROUP_LINK, processIsntanceEvent.getAction());
List<String> processInstanceEventMessageParts = processIsntanceEvent.getMessageParts();
assertEquals("muppets", processInstanceEventMessageParts.get(0));
assertEquals(IdentityLinkType.PARTICIPANT, processInstanceEventMessageParts.get(1));
assertEquals(2, processInstanceEventMessageParts.size());
assertEquals(2, processInstanceEvents.size());
}