You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/02/28 07:54:08 UTC

[GitHub] [incubator-shardingsphere] zjcnb commented on a change in pull request #4511: T0 add ut for sharding-orchestration-core module

zjcnb commented on a change in pull request #4511: T0 add ut for sharding-orchestration-core module
URL: https://github.com/apache/incubator-shardingsphere/pull/4511#discussion_r385551687
 
 

 ##########
 File path: sharding-orchestration/sharding-orchestration-core/src/test/java/org/apache/shardingsphere/orchestration/internal/registry/config/listener/SchemaChangedListenerTest.java
 ##########
 @@ -170,4 +170,42 @@ public void assertCreateSchemaDeletedEventForNewSchema() {
         assertThat(actual, instanceOf(SchemaDeletedEvent.class));
         assertThat(((SchemaDeletedEvent) actual).getShardingSchemaName(), is("logic_db"));
     }
+    
+    @Test
+    public void assertCreateWithInvalidNodeChangedEvent() {
+        DataChangedEvent dataChangedEvent = new DataChangedEvent("/test/config/schema/logic_db", DATA_SOURCE_YAML, ChangedType.DELETED);
+        ShardingOrchestrationEvent actual = schemaChangedListener.createShardingOrchestrationEvent(dataChangedEvent);
+        assertThat(actual, instanceOf(IgnoredShardingOrchestrationEvent.class));
+    }
+    
+    @Test
+    public void assertCreateWithNullShardingSchemaName() {
+        DataChangedEvent dataChangedEvent = new DataChangedEvent("/test/config/schema/datasource", DATA_SOURCE_YAML, ChangedType.DELETED);
+        ShardingOrchestrationEvent actual = schemaChangedListener.createShardingOrchestrationEvent(dataChangedEvent);
+        assertThat(actual, instanceOf(IgnoredShardingOrchestrationEvent.class));
+    }
+    
+    @Test
+    public void assertCreateAddedEventWithEncryptRuleConfigurationForNewSchema() {
+        DataChangedEvent dataChangedEvent = new DataChangedEvent("/test/config/schema/encrypt_db/rule", ENCRYPT_RULE_YAML, ChangedType.UPDATED);
 
 Review comment:
   ok,I'll fix it later

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services