DaanHoogland commented on code in PR #7112:
URL: https://github.com/apache/cloudstack/pull/7112#discussion_r1095806270


##########
api/src/test/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmdTest.java:
##########
@@ -100,12 +100,20 @@ public void testGetNetworkName() {
         Assert.assertEquals(cmd.getNetworkName(), netName);
     }
 
-    public void testGetDisplayText() {
+    public void testGetDisplayTextWhenNotEmpty() {
         String description = "Isolated Network";
         ReflectionTestUtils.setField(cmd, "displayText", description);
         Assert.assertEquals(cmd.getDisplayText(), description);
     }
 
+    public void testGetDisplayTextWhenEmpty() {
+        String description = null;
+        String netName = "net-isolated";
+        ReflectionTestUtils.setField(cmd, "displayText", description);
+        ReflectionTestUtils.setField(cmd, "name", netName);
+        Assert.assertEquals(cmd.getDisplayText(), netName);
+    }

Review Comment:
   i think this is not the behaviour we want to test. Instead I think we need to
   ```suggestion
       public void testGetDisplayTextWhenEmpty() {
           String description = null;
           String netName = "net-isolated";
           ReflectionTestUtils.setField(cmd, "name", netName);
           Assert.assertEquals(cmd.getDisplayText(), netName);
       }
   ```



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

Reply via email to