diff --git a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/route/finder/dml/AbstractShadowDMLStatementDataSourceMappingsFinder.java b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/route/finder/dml/AbstractShadowDMLStatementDataSourceMappingsFinder.java index 6f6bf6e859d61..8c95b2674156f 100644 --- a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/route/finder/dml/AbstractShadowDMLStatementDataSourceMappingsFinder.java +++ b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/route/finder/dml/AbstractShadowDMLStatementDataSourceMappingsFinder.java @@ -83,8 +83,8 @@ public Map find(final ShadowRule rule) { private boolean isMatchDefaultAlgorithm(final ShadowRule rule) { Optional defaultAlgorithm = rule.getDefaultShadowAlgorithm(); if (defaultAlgorithm.isPresent() && defaultAlgorithm.get() instanceof HintShadowAlgorithm) { - ShadowCondition determineCondition = new ShadowCondition("", ShadowOperationType.HINT_MATCH); - return HintShadowAlgorithmDeterminer.isShadow((HintShadowAlgorithm>) defaultAlgorithm.get(), determineCondition, rule, isShadow); + ShadowCondition shadowCondition = new ShadowCondition("", ShadowOperationType.HINT_MATCH); + return HintShadowAlgorithmDeterminer.isShadow((HintShadowAlgorithm>) defaultAlgorithm.get(), shadowCondition, rule, isShadow); } return false; } diff --git a/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/ColumnShadowAlgorithmDeterminerTest.java b/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/ColumnShadowAlgorithmDeterminerTest.java index bc0f792fffa90..0872b5a0e12aa 100644 --- a/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/ColumnShadowAlgorithmDeterminerTest.java +++ b/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/ColumnShadowAlgorithmDeterminerTest.java @@ -39,10 +39,10 @@ class ColumnShadowAlgorithmDeterminerTest { void assertIsShadow() { Properties props = PropertiesBuilder.build(new Property("column", "user_id"), new Property("operation", "insert"), new Property("regex", "[1]")); assertTrue(ColumnShadowAlgorithmDeterminer.isShadow( - (ColumnShadowAlgorithm) TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH", props), createShadowDetermineCondition())); + (ColumnShadowAlgorithm) TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH", props), createShadowCondition())); } - private ShadowCondition createShadowDetermineCondition() { + private ShadowCondition createShadowCondition() { return new ShadowCondition("t_order", ShadowOperationType.INSERT, new ShadowColumnCondition("t_order", "user_id", Collections.singleton(1))); } } diff --git a/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/HintShadowAlgorithmDeterminerTest.java b/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/HintShadowAlgorithmDeterminerTest.java index e21f25a38c1a4..51f58c3799c16 100644 --- a/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/HintShadowAlgorithmDeterminerTest.java +++ b/features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/route/determiner/HintShadowAlgorithmDeterminerTest.java @@ -44,7 +44,7 @@ class HintShadowAlgorithmDeterminerTest { void assertIsShadow() { HintShadowAlgorithm hintShadowAlgorithm = (HintShadowAlgorithm) TypedSPILoader.getService(ShadowAlgorithm.class, "SQL_HINT", new Properties()); HintValueContext hintValueContext = createHintValueContext(); - assertTrue(HintShadowAlgorithmDeterminer.isShadow(hintShadowAlgorithm, createShadowDetermineCondition(), new ShadowRule(createShadowRuleConfiguration()), hintValueContext.isShadow())); + assertTrue(HintShadowAlgorithmDeterminer.isShadow(hintShadowAlgorithm, createShadowCondition(), new ShadowRule(createShadowRuleConfiguration()), hintValueContext.isShadow())); } private HintValueContext createHintValueContext() { @@ -68,7 +68,7 @@ private Collection createDataSources() { return result; } - private ShadowCondition createShadowDetermineCondition() { + private ShadowCondition createShadowCondition() { return new ShadowCondition("t_order", ShadowOperationType.INSERT); } }