@Override
	public Map<String, String> apply(ServerWebExchange exchange) {
		StainingRule stainingRule = stainingRuleManager.getStainingRule();

		if (stainingRule == null) {
			return Collections.emptyMap();
		}

		return ruleStainingExecutor.execute(exchange, stainingRule);
	}
@Test
	public void testWithStainingRule() {
		RuleStainingProperties ruleStainingProperties = new RuleStainingProperties();
		ruleStainingProperties.setNamespace(testNamespace);
		ruleStainingProperties.setGroup(testGroup);
		ruleStainingProperties.setFileName(testFileName);

		ConfigFile configFile = Mockito.mock(ConfigFile.class);
		when(configFile.getContent()).thenReturn("{\n"
				+ "    \"rules\":[\n"
				+ "        {\n"
				+ "            \"conditions\":[\n"
				+ "                {\n"
				+ "                    \"key\":\"${http.query.uid}\",\n"
				+ "                    \"values\":[\"1000\"],\n"
				+ "                    \"operation\":\"EQUALS\"\n"
				+ "                }\n"
				+ "            ],\n"
				+ "            \"labels\":[\n"
				+ "                {\n"
				+ "                    \"key\":\"env\",\n"
				+ "                    \"value\":\"blue\"\n"
				+ "                }\n"
				+ "            ]\n"
				+ "        }\n"
				+ "    ]\n"
				+ "}");
		when(configFileService.getConfigFile(testNamespace, testGroup, testFileName)).thenReturn(configFile);

		StainingRuleManager stainingRuleManager = new StainingRuleManager(ruleStainingProperties, configFileService);
		RuleStainingExecutor ruleStainingExecutor = new RuleStainingExecutor();
		RuleTrafficStainer ruleTrafficStainer = new RuleTrafficStainer(stainingRuleManager, ruleStainingExecutor);

		MockServerHttpRequest request = MockServerHttpRequest.get("/users")
				.queryParam("uid", "1000").build();
		MockServerWebExchange exchange = new MockServerWebExchange.Builder(request).build();

		Map<String, String> map = ruleTrafficStainer.apply(exchange);
		assertThat(map).isNotNull();
		assertThat(map.size()).isEqualTo(1);
		assertThat(map.get("env")).isEqualTo("blue");
	}