@PostMapping("/plugin/selector/saveOrUpdate")
    public Mono<String> saveSelector(@RequestBody final SelectorData selectorData) {
        if (StringUtils.isEmpty(selectorData.getPluginName())) {
            return Mono.just("Error: please add pluginName!");
        }
        SelectorData defaultSelectorData = buildDefaultSelectorData(selectorData);
        subscriber.onSelectorSubscribe(defaultSelectorData);
        saveDiscoveryUpstreamData(defaultSelectorData);
        return Mono.just(selectorData.getId());
    }
@Test
    public void saveSelector() throws Exception {
        final String selectorPluginName = "testSaveSelector";
        final SelectorData selectorData = new SelectorData();
        selectorData.setPluginName(selectorPluginName);
        final String json = GsonUtils.getGson().toJson(selectorData);
        this.mockMvc
                .perform(MockMvcRequestBuilders.post("/shenyu/plugin/selector/saveOrUpdate")
                        .content(json)
                        .contentType(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andReturn();
        assertThat(baseDataCache.obtainSelectorData(selectorPluginName)).isNotNull();

        final String selectorPluginNameError = "testSaveSelectorError";
        final SelectorData selectorDataError = new SelectorData();
        selectorData.setPluginName(selectorPluginNameError);
        final String jsonError = GsonUtils.getGson().toJson(selectorDataError);
        final Object resultErr = this.mockMvc
                .perform(MockMvcRequestBuilders.post("/shenyu/plugin/selector/saveOrUpdate")
                        .content(jsonError)
                        .contentType(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andReturn()
                .getAsyncResult();
        assertThat(resultErr).isEqualTo("Error: please add pluginName!");
    }