yx9o commented on code in PR #22860:
URL: https://github.com/apache/shardingsphere/pull/22860#discussion_r1048351973
##########
features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/update/DropDefaultShadowAlgorithmStatementUpdaterTest.java:
##########
@@ -55,12 +59,15 @@ public void assertCheckWithIfExists() {
@Test
public void assertUpdate() {
+ String algorithmName = "default";
ShadowRuleConfiguration ruleConfig = new ShadowRuleConfiguration();
- ruleConfig.setDefaultShadowAlgorithmName("default");
+ ruleConfig.getShadowAlgorithms().put(algorithmName,
mock(AlgorithmConfiguration.class));
+ ruleConfig.setDefaultShadowAlgorithmName(algorithmName);
DropDefaultShadowAlgorithmStatement statement = new
DropDefaultShadowAlgorithmStatement(false);
updater.checkSQLStatement(database, new
DropDefaultShadowAlgorithmStatement(true), ruleConfig);
assertTrue(updater.hasAnyOneToBeDropped(statement, ruleConfig));
updater.updateCurrentRuleConfiguration(statement, ruleConfig);
assertNull(ruleConfig.getDefaultShadowAlgorithmName());
+ assertThat(ruleConfig.getShadowAlgorithms().size(), is(0));
Review Comment:
> `assertTrue(ruleConfig.getShadowAlgorithms().isEmpty());` will be better?
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]