@Bean
    @ConditionalOnProperty(name = "shenyu.shared-pool.enable", havingValue = "true", matchIfMissing = true)
    public ShenyuThreadPoolExecutor shenyuThreadPoolExecutor(final ShenyuConfig shenyuConfig,
                                                             final @Qualifier("taskQueue") ObjectProvider<TaskQueue<Runnable>> provider) {
        final ShenyuConfig.SharedPool sharedPool = shenyuConfig.getSharedPool();
        final Integer corePoolSize = sharedPool.getCorePoolSize();
        final Integer maximumPoolSize = sharedPool.getMaximumPoolSize();
        final Long keepAliveTime = sharedPool.getKeepAliveTime();
        return new ShenyuThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime,
                TimeUnit.MILLISECONDS, provider.getIfAvailable(() -> new MemorySafeTaskQueue<>(Constants.THE_256_MB)),
                ShenyuThreadFactory.create(sharedPool.getPrefix(), true),
                new ThreadPoolExecutor.AbortPolicy());
    }
@Test
    public void testShenyuThreadPoolExecutor() {
        ShenyuConfig shenyuConfig = mock(ShenyuConfig.class);
        ObjectProvider objectProvider = mock(ObjectProvider.class);
        ShenyuConfig.SharedPool sharedPool = mock(ShenyuConfig.SharedPool.class);
        when(shenyuConfig.getSharedPool()).thenReturn(sharedPool);
        when(sharedPool.getCorePoolSize()).thenReturn(1);
        when(sharedPool.getMaximumPoolSize()).thenReturn(1);
        when(sharedPool.getKeepAliveTime()).thenReturn(60L);
        when(sharedPool.getPrefix()).thenReturn("TEST-");
        when(objectProvider.getIfAvailable()).thenReturn(null);
        assertNotNull(shenyuThreadPoolConfiguration.shenyuThreadPoolExecutor(shenyuConfig, new TestObjectProvider<>(null)));
        assertNotNull(shenyuThreadPoolConfiguration.shenyuThreadPoolExecutor(shenyuConfig, new TestObjectProvider<>(new MemorySafeTaskQueue<>(Constants.THE_256_MB))));
    }