Map<String, String> execute(ServerWebExchange exchange, StainingRule stainingRule) {
		if (stainingRule == null) {
			return Collections.emptyMap();
		}

		List<StainingRule.Rule> rules = stainingRule.getRules();
		if (CollectionUtils.isEmpty(rules)) {
			return Collections.emptyMap();
		}

		Map<String, String> parsedLabels = new HashMap<>();

		for (StainingRule.Rule rule : rules) {
			List<Condition> conditions = rule.getConditions();

			Set<String> keys = new HashSet<>();
			conditions.forEach(condition -> keys.add(condition.getKey()));
			Map<String, String> actualValues = SpringWebExpressionLabelUtils.resolve(exchange, keys);

			if (!ConditionUtils.match(actualValues, conditions)) {
				continue;
			}

			parsedLabels.putAll(KVPairUtils.toMap(rule.getLabels()));
		}

		return parsedLabels;
	}
@Test
	public void testNotMatchCondition() {
		Condition condition1 = new Condition();
		condition1.setKey("${http.header.uid}");
		condition1.setOperation(Operation.EQUALS.toString());
		condition1.setValues(Collections.singletonList("1000"));

		Condition condition2 = new Condition();
		condition2.setKey("${http.query.source}");
		condition2.setOperation(Operation.IN.toString());
		condition2.setValues(Collections.singletonList("wx"));

		StainingRule.Rule rule = new StainingRule.Rule();
		rule.setConditions(Arrays.asList(condition1, condition2));

		KVPair kvPair = new KVPair();
		kvPair.setKey("env");
		kvPair.setValue("blue");
		rule.setLabels(Collections.singletonList(kvPair));

		StainingRule stainingRule = new StainingRule();
		stainingRule.setRules(Collections.singletonList(rule));

		MockServerHttpRequest request = MockServerHttpRequest.get("/users")
				.queryParam("source", "wx")
				.header("uid", "10001").build();
		MockServerWebExchange exchange = new MockServerWebExchange.Builder(request).build();

		RuleStainingExecutor executor = new RuleStainingExecutor();

		Map<String, String> stainedLabels = executor.execute(exchange, stainingRule);

		assertThat(stainedLabels).isNotNull();
		assertThat(stainedLabels.size()).isEqualTo(0);
	}