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/03/01 05:03:02 UTC

[GitHub] [incubator-shardingsphere] dongzl commented on a change in pull request #4531: Add unit test case for sharding-orchestration-center-apollo module #4451

dongzl commented on a change in pull request #4531: Add unit test case for sharding-orchestration-center-apollo module #4451
URL: https://github.com/apache/incubator-shardingsphere/pull/4531#discussion_r386077049
 
 

 ##########
 File path: sharding-orchestration/sharding-orchestration-center/sharding-orchestration-center-apollo/src/test/java/org/apache/shardingsphere/orchestration/center/instance/ApolloInstanceTest.java
 ##########
 @@ -82,4 +91,65 @@ public void onChange(final DataChangedEvent dataChangedEvent) {
         assertThat(changeEvent.getValue(), is("value3"));
         assertThat(changeEvent.getChangedType(), is(DataChangedEvent.ChangedType.UPDATED));
     }
+
+    @Test
+    @SneakyThrows
+    public void assertGetWithNonExistentKey() {
+        when(openApiWrapper.getValue(eq("test.nonExistentKey"))).thenReturn(null);
 
 Review comment:
   If assert null, we can assert directly, no need `when ... thenReturn`.

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