@Override
    protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {
        final ShenyuContext shenyuContext = exchange.getAttribute(Constants.CONTEXT);
        Objects.requireNonNull(shenyuContext);
        Resilience4JHandle resilience4JHandle = Resilience4JHandler.CACHED_HANDLE.get().obtainHandle(CacheKeyUtils.INST.getKey(rule));
        resilience4JHandle.checkData(resilience4JHandle);
        if (resilience4JHandle.getCircuitEnable() == 1) {
            return combined(exchange, chain, rule);
        }
        return rateLimiter(exchange, chain, rule);
    }
@Test
    @SuppressWarnings({"rawtypes", "unchecked"})
    public void circuitBreakerTest() {
        RuleData data = mock(RuleData.class);
        data.setSelectorId("SHENYU");
        data.setId("SHENYU");
        Resilience4JHandle resilience4JHandle = GsonUtils.getGson().fromJson(HANDLER, Resilience4JHandle.class);
        Resilience4JHandler.CACHED_HANDLE.get().cachedHandle(CacheKeyUtils.INST.getKey(data), resilience4JHandle);
        CombinedExecutor combinedExecutor = new CombinedExecutor();
        resilience4JPlugin = new Resilience4JPlugin(combinedExecutor, new RateLimiterExecutor());
        Mono mono = Mono.error(CallNotPermittedException.createCallNotPermittedException(circuitBreaker)).onErrorResume(throwable -> {
            if (throwable instanceof CallNotPermittedException) {
                exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);
            }
            return Mono.error(throwable);
        });
        when(data.getHandle()).thenReturn(HANDLER);
        when(chain.execute(exchange)).thenReturn(mono);
        when(data.getSelectorId()).thenReturn("circuitBreaker");
        when(data.getId()).thenReturn("ruleData");
        Resilience4JHandler.CACHED_HANDLE.get().cachedHandle(CacheKeyUtils.INST.getKey(data), resilience4JHandle);
        SelectorData selectorData = mock(SelectorData.class);
        StepVerifier.create(resilience4JPlugin.doExecute(exchange, chain, selectorData, data))
                .expectSubscription()
                .expectError()
                .verify();
        assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, exchange.getResponse().getStatusCode());
    }