@Test
public void testRemoveBusinessAdmin() {

    processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
    Assertions.assertThat(processInstanceId).isNotNull();
    
    List<TaskSummary> tasks = runtimeDataService.getTasksAssignedAsBusinessAdministrator("Administrator", new QueryFilter());
    Assertions.assertThat(tasks).hasSize(1);
    TaskSummary task = tasks.get(0);
    
    userTaskAdminService.removeBusinessAdmins(task.getId(), factory.newUser("Administrator"));
    List<TaskEvent> events = runtimeDataService.getTaskEvents(task.getId(), new QueryFilter());
    Assertions.assertThat(events).hasSize(3);
    TaskEvent updatedEvent = events.get(2);
    Assertions.assertThat(updatedEvent.getMessage()).isEqualTo("Business administrators [Administrator] have been removed");
    List<Status> readyStatuses = Arrays.asList(new Status[]{
            org.kie.api.task.model.Status.Ready
    });
    
    tasks = runtimeDataService.getTasksAssignedAsBusinessAdministratorByStatus("Administrator", readyStatuses, new QueryFilter());
    Assertions.assertThat(tasks).hasSize(0);
}