@Override
    protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {
        CasdoorAuthService casdoorAuthService = Singleton.INST.get(CasdoorAuthService.class);
        ServerHttpRequest request = exchange.getRequest();
        String token = exchange.getRequest().getHeaders().getFirst(HttpHeaders.AUTHORIZATION);
        if (Objects.nonNull(token)) {
            CasdoorUser casdoorUser = casdoorAuthService.parseJwtToken(token);
            if (Objects.nonNull(casdoorUser)) {
                return chain.execute(handleToken(exchange, casdoorUser));
            }
        }
        MultiValueMap<String, String> queryParams = request.getQueryParams();
        String code = queryParams.getFirst("code");
        String state = queryParams.getFirst("state");
        if (Objects.nonNull(code) || Objects.nonNull(state)) {
            token = casdoorAuthService.getOAuthToken(code, state);
            CasdoorUser casdoorUser = casdoorAuthService.parseJwtToken(token);
            if (Objects.nonNull(casdoorUser)) {
                return chain.execute(handleToken(exchange, casdoorUser));
            }
        }
        Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.ERROR_TOKEN);
        return WebFluxResultUtils.result(exchange, error);
    }
@Test
    void doExecute() {
        final PluginData pluginData = new PluginData("pluginId", "pluginName", "{\"organization-name\":\"test\",\"application-name\":\"app-test\",\"endpoint\":\"http://localhost:8000\",\"client_secrect\":\"a4209d412a33a842b7a9c05a3446e623cbb7262d\",\"client_id\":\"6e3a84154e73d1fb156a\",\"certificate\":\"-----BEGIN CERTIFICATE-----\\n\"}", "0", false, null);
        casdoorPluginDateHandlerTest.handlerPlugin(pluginData);
        try {
            CasdoorAuthService casdoorAuthService = Singleton.INST.get(CasdoorAuthService.class);
            casdoorPluginTest.doExecute(exchange, chain, selector, rule);
        } catch (Exception e) {
            Assumptions.assumeTrue(e instanceof CasdoorAuthException);
        }

        CasdoorAuthService casdoorAuthService = mock(CasdoorAuthService.class);
        String token = exchange.getRequest().getHeaders().getFirst(HttpHeaders.AUTHORIZATION);
        CasdoorUser casdoorUser = new CasdoorUser();
        Mockito.when(casdoorAuthService.parseJwtToken(token)).thenReturn(casdoorUser);
        Singleton.INST.single(CasdoorAuthService.class, casdoorAuthService);
        when(this.chain.execute(any())).thenReturn(Mono.empty());
        Mono<Void> mono = casdoorPluginTest.doExecute(exchange, chain, selector, rule);
        StepVerifier.create(mono).expectSubscription().verifyComplete();

        exchange = MockServerWebExchange.from(MockServerHttpRequest
                .get("localshost")
                .queryParam("state", "state")
                .queryParam("code", "code")
                .build());
        Mockito.when(casdoorAuthService.getOAuthToken("code", "state")).thenReturn(token);
        Singleton.INST.single(CasdoorAuthService.class, casdoorAuthService);
        mono = casdoorPluginTest.doExecute(exchange, chain, selector, rule);
        StepVerifier.create(mono).expectSubscription().verifyComplete();

        exchange = MockServerWebExchange.from(MockServerHttpRequest
                .get("localshost")
                .build());
        mono = casdoorPluginTest.doExecute(exchange, chain, selector, rule);
        StepVerifier.create(mono).expectSubscription().verifyComplete();
    }