Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1365#discussion_r58787329
  
    --- Diff: server/test/com/cloud/vm/UserVmManagerTest.java ---
    @@ -928,4 +928,13 @@ public void testUpdateVmNicIpFailure3() throws 
Exception {
                 CallContext.unregister();
             }
         }
    +
    +    @Test
    +    public void testPersistDeviceBusInfo() {
    +        when(_vmMock.getDetail(any(String.class))).thenReturn(null);
    +        _userVmMgr.persistDeviceBusInfo(_vmMock, null);
    +        verify(_vmDao, times(0)).saveDetails(any(UserVmVO.class));
    +        _userVmMgr.persistDeviceBusInfo(_vmMock, "lsilogic");
    +        verify(_vmDao, times(1)).saveDetails(any(UserVmVO.class));
    --- End diff --
    
    Why not split these two ``verify`` into two separate test methods to better 
express the scenario being tested?  It would help with diagnosing the specific 
failure and make the code more maintainable.
    
    Also, please add test cases for when the ``existingVmRootDiskController`` 
is empty and ``rootDiskController`` is empty.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to