@Override
    public Executor getExecutor(final URL url) {
        try {
            return SpringBeanUtils.getInstance().getBean(ShenyuThreadPoolExecutor.class);
        } catch (NoSuchBeanDefinitionException t) {
            throw new ShenyuException("shared thread pool is not enable, config ${shenyu.sharedPool.enable} in your xml/yml !", t);
        }
    }
@Test
    public void testGetExecutor() {
        ShenyuThreadPoolExecutor shenyuThreadPoolExecutor = new ShenyuThreadPoolExecutor(1,
                2, 30, TimeUnit.SECONDS, new MemorySafeTaskQueue<>(100),
                Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());
        SpringBeanUtils.getInstance().setApplicationContext(mock(ConfigurableApplicationContext.class));
        when(SpringBeanUtils.getInstance().getBean(ShenyuThreadPoolExecutor.class)).thenReturn(shenyuThreadPoolExecutor);
        assertEquals(sharedThreadPool.getExecutor(URL.valueOf("localhost")), shenyuThreadPoolExecutor);

        when(SpringBeanUtils.getInstance().getBean(ShenyuThreadPoolExecutor.class)).thenThrow(new NoSuchBeanDefinitionException("not bean"));
        assertThrows(ShenyuException.class, () -> sharedThreadPool.getExecutor(URL.valueOf("localhost")));
    }