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 2021/05/17 04:05:18 UTC

[GitHub] [shardingsphere] SteNicholas commented on a change in pull request #10355: Add more assertions of GovernanceFacadeTest.assertInit()

SteNicholas commented on a change in pull request #10355:
URL: https://github.com/apache/shardingsphere/pull/10355#discussion_r633208176



##########
File path: shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/facade/GovernanceFacadeTest.java
##########
@@ -47,7 +48,9 @@ public void assertInit() {
         GovernanceConfiguration config = new GovernanceConfiguration("test_name", new RegistryCenterConfiguration("TEST", "127.0.0.1", new Properties()), false);
         governanceFacade.init(config, Arrays.asList("schema_0", "schema_1"));
         assertNotNull(governanceFacade.getRegistryCenter());
-        // TODO use reflection to assert attributes of GovernanceFacade
+        assertFalse((Boolean) getField(governanceFacade, "isOverwrite"));

Review comment:
       IMO, this should add validation for the field type of `isOverwrite`, which verify whether `isOverwrite ` is boolean type and then convert to `Boolean` type object.

##########
File path: shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/facade/GovernanceFacadeTest.java
##########
@@ -47,7 +48,9 @@ public void assertInit() {
         GovernanceConfiguration config = new GovernanceConfiguration("test_name", new RegistryCenterConfiguration("TEST", "127.0.0.1", new Properties()), false);
         governanceFacade.init(config, Arrays.asList("schema_0", "schema_1"));
         assertNotNull(governanceFacade.getRegistryCenter());
-        // TODO use reflection to assert attributes of GovernanceFacade
+        assertFalse((Boolean) getField(governanceFacade, "isOverwrite"));
+        assertNotNull(getField(governanceFacade, "registryCenterRepository"));

Review comment:
       This could validate the field value of `registryCenterRepository`, not only verify whether the field value is not null.




-- 
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