<commit_before>package org.innovateuk.ifs.async.config;

import org.innovateuk.ifs.async.generation.AsyncFuturesGenerator;
import org.innovateuk.ifs.commons.BaseIntegrationTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.TestPropertySource;

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.innovateuk.ifs.util.CollectionFunctions.combineLists;
import static org.junit.Assert.assertEquals;

/**
 * Tests for the configuration of our {@link AsyncThreadPoolTaskExecutorConfig} configuration that allows us
 * to specify our own {@link java.util.concurrent.ThreadPoolExecutor} for the execution of @Async code blocks
 */
@TestPropertySource(properties = "ifs.web.ajp.connections.max.total=3")
public class AsyncThreadPoolTaskExecutorConfigIntegrationTest extends BaseIntegrationTest {

    @Autowired
    private AsyncThreadPoolTaskExecutorConfigIntegrationTestHelper helper;
<commit_msg>Enhancing existing test suite to sanity check correct autowire candidates<commit_after>package org.innovateuk.ifs.async.config;

import org.innovateuk.ifs.async.executor.AsyncTaskDecorator;
import org.innovateuk.ifs.async.generation.AsyncFuturesGenerator;
import org.innovateuk.ifs.commons.BaseIntegrationTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.util.ReflectionTestUtils;

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.innovateuk.ifs.util.CollectionFunctions.combineLists;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Tests for the configuration of our {@link AsyncThreadPoolTaskExecutorConfig} configuration that allows us
 * to specify our own {@link java.util.concurrent.ThreadPoolExecutor} for the execution of @Async code blocks
 */
@TestPropertySource(properties = "ifs.web.ajp.connections.max.total=3")
public class AsyncThreadPoolTaskExecutorConfigIntegrationTest extends BaseIntegrationTest {

    @Autowired
    private AsyncThreadPoolTaskExecutorConfigIntegrationTestHelper helper;

    @Autowired
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;

    /**
     * This test is just a sanity check that we have autowired the correct task executor
     */
    @Test
    public void testThreadPoolTaskExecutorIsCorrectOne() {
        assertEquals("IFS-Async-Executor-", threadPoolTaskExecutor.getThreadNamePrefix());
        assertTrue(ReflectionTestUtils.getField(threadPoolTaskExecutor, "taskDecorator") instanceof AsyncTaskDecorator);
    }

{'fraction_non_alphanumeric': 0.07922037095253065, 'fraction_numerical': 0.0006287331027978623, 'mean_word_length': 6.4, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4561666', 'n_tokens_mistral': 852, 'n_tokens_neox': 855, 'n_words': 185}