@Deprecated
    public PassiveCompletableFuture<TaskExecutionState> deployLocalTask(
            @NonNull TaskGroup taskGroup) {
        return deployLocalTask(
                taskGroup, Thread.currentThread().getContextClassLoader(), emptyList());
    }
@Test
    public void testFinish() {
        TaskExecutionService taskExecutionService = server.getTaskExecutionService();

        long sleepTime = 300;

        AtomicBoolean stop = new AtomicBoolean(false);
        AtomicBoolean futureMark = new AtomicBoolean(false);
        TestTask testTask1 = new TestTask(stop, LOGGER, sleepTime, true);
        TestTask testTask2 = new TestTask(stop, LOGGER, sleepTime, false);

        final CompletableFuture<TaskExecutionState> completableFuture =
                taskExecutionService.deployLocalTask(
                        new TaskGroupDefaultImpl(
                                new TaskGroupLocation(
                                        jobId, pipeLineId, FLAKE_ID_GENERATOR.newId()),
                                "ts",
                                Lists.newArrayList(testTask1, testTask2)));
        completableFuture.whenComplete((unused, throwable) -> futureMark.set(true));
        stop.set(true);

        await().atMost(sleepTime + 10000, TimeUnit.MILLISECONDS)
                .untilAsserted(
                        () -> {
                            assertEquals(FINISHED, completableFuture.get().getExecutionState());
                        });
        assertTrue(futureMark.get());
    }