@Test
public void testAddPotentialOwnersNotBusinessAdmin() {

    identityProvider.setName("notAdmin");
    processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
    Assertions.assertThat(processInstanceId).isNotNull();
    
    List<TaskSummary> tasks = runtimeDataService.getTasksAssignedAsPotentialOwner("salaboy", new QueryFilter());
    Assertions.assertThat(tasks).hasSize(1);
    TaskSummary task = tasks.get(0);
    
    userTaskService.release(task.getId(), "salaboy");
    Assertions.assertThatThrownBy(
            () -> userTaskAdminService.addPotentialOwners(task.getId(), false, factory.newUser("john")))
            .hasMessageContaining("User notAdmin is not business admin of task 1");
}