Search in sources :

Example 1 with TaskExecutorCustomizer

use of org.springframework.boot.task.TaskExecutorCustomizer in project spring-boot by spring-projects.

the class TaskExecutionAutoConfigurationTests method taskExecutorBuilderShouldApplyCustomizer.

@Test
void taskExecutorBuilderShouldApplyCustomizer() {
    this.contextRunner.withUserConfiguration(TaskExecutorCustomizerConfig.class).run((context) -> {
        TaskExecutorCustomizer customizer = context.getBean(TaskExecutorCustomizer.class);
        ThreadPoolTaskExecutor executor = context.getBean(TaskExecutorBuilder.class).build();
        then(customizer).should().customize(executor);
    });
}
Also used : ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) TaskExecutorBuilder(org.springframework.boot.task.TaskExecutorBuilder) TaskExecutorCustomizer(org.springframework.boot.task.TaskExecutorCustomizer) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 TaskExecutorBuilder (org.springframework.boot.task.TaskExecutorBuilder)1 TaskExecutorCustomizer (org.springframework.boot.task.TaskExecutorCustomizer)1 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)1