### Question:
SchedulerConfig implements SchedulingConfigurer { @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { ThreadPoolTaskScheduler threadPool = new ThreadPoolTaskScheduler(); threadPool.setPoolSize(poolSize); threadPool.setThreadNamePrefix("consent-scheduler-pool"); threadPool.initialize(); scheduledTaskRegistrar.setTaskScheduler(threadPool); }  @Override void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar);  }### Answer:
@Test void configureTasks() { ArgumentCaptor<ThreadPoolTaskScheduler> threadPoolTaskSchedulerCaptor = ArgumentCaptor.forClass(ThreadPoolTaskScheduler.class); ScheduledTaskRegistrar scheduledTaskRegistrar = mock(ScheduledTaskRegistrar.class); doNothing().when(scheduledTaskRegistrar).setTaskScheduler(threadPoolTaskSchedulerCaptor.capture()); SchedulerConfig schedulerConfig = new SchedulerConfig(); ReflectionTestUtils.setField(schedulerConfig, "poolSize", 10); schedulerConfig.configureTasks(scheduledTaskRegistrar); assertEquals("consent-scheduler-pool", threadPoolTaskSchedulerCaptor.getValue().getThreadNamePrefix()); assertEquals(10, threadPoolTaskSchedulerCaptor.getValue().getScheduledThreadPoolExecutor().getCorePoolSize()); }