@Override
    protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {
        Map<String, List<GeneralContextHandle>> generalContextHandleMap = GeneralContextPluginDataHandler.CACHED_HANDLE.get().obtainHandle(CacheKeyUtils.INST.getKey(rule));
        if (generalContextHandleMap.isEmpty()) {
            return chain.execute(exchange);
        }
        Map<String, Map<String, String>> generalContextMap = new HashMap<>();
        HttpHeaders headers = exchange.getRequest().getHeaders();
        generalContextHandleMap.forEach((rpcType, v) -> {
            if (CollectionUtils.isEmpty(v)) {
                return;
            }
            Map<String, String> generalContextMapWithRpcType = new HashMap<>();
            v.forEach(each -> {
                if (StringUtils.isBlank(each.getGeneralContextType()) || StringUtils.isBlank(each.getGeneralContextKey())) {
                    return;
                }
                switch (each.getGeneralContextType()) {
                    case Constants.ADD_GENERAL_CONTEXT_TYPE:
                        generalContextMapWithRpcType.put(each.getGeneralContextKey(), each.getGeneralContextValue());
                        break;
                    case Constants.TRANSMIT_HEADER_TO_GENERAL_CONTEXT_TYPE:
                        final List<String> header = headers.get(each.getGeneralContextKey());
                        generalContextMapWithRpcType.put(StringUtils.isBlank(each.getGeneralContextValue()) ? each.getGeneralContextKey() : each.getGeneralContextValue(),
                                CollectionUtils.isEmpty(header) ? null : String.join(", ", header));
                        break;
                    default:
                        break;
                }
            });
            generalContextMap.put(rpcType, generalContextMapWithRpcType);
        });
        exchange.getAttributes().put(Constants.GENERAL_CONTEXT, generalContextMap);
        return chain.execute(exchange);
    }
@Test
    public void testDoExecute() {
        SelectorData selectorData = mock(SelectorData.class);
        when(this.chain.execute(any())).thenReturn(Mono.empty());

        StepVerifier.create(generalContextPlugin.doExecute(this.exchange, this.chain, selectorData, this.ruleData)).expectSubscription().verifyComplete();

        ArgumentCaptor<ServerWebExchange> newExchange = ArgumentCaptor.forClass(ServerWebExchange.class);
        Mockito.verify(this.chain, times(1)).execute(newExchange.capture());

        Map<String, String> shenyuGeneralContext = ((Map<String, Map<String, String>>) newExchange.getValue().getAttributes().get(Constants.GENERAL_CONTEXT)).get(PluginEnum.DUBBO.getName());

        assertTrue(shenyuGeneralContext.containsKey("addGeneralContextKey"));
        assertTrue(shenyuGeneralContext.containsKey("shenyuTestHeaderNewKey"));

        assertEquals(shenyuGeneralContext.get("addGeneralContextKey"), "addGeneralContextValue");
        assertEquals(shenyuGeneralContext.get("shenyuTestHeaderNewKey"), "shenyuTestHeaderValue");
        shenyuGeneralContext = ((Map<String, Map<String, String>>) newExchange.getValue().getAttributes().get(Constants.GENERAL_CONTEXT)).get(PluginEnum.SOFA.getName());
        assertNull(shenyuGeneralContext);
    }