@Test
public void testUpdateSystemvmPassword() {

    //setup
    String realusername = System.getProperty("user.name");
    System.setProperty("user.name", "cloud");
    Mockito.when(_configDao.getValue("system.vm.random.password")).thenReturn(String.valueOf(true));
    TransactionLegacy.open("cloud");
    Mockito.when(_mgrService.generateRandomPassword()).thenReturn("randomPassword");
    //call the method to test
    configurationServer.updateSystemvmPassword();
    //verify that generateRandomPassword() is called
    Mockito.verify(_mgrService, Mockito.times(1)).generateRandomPassword();
    //teardown
    System.setProperty("user.name", realusername);
}