@SuppressWarnings("unchecked")
@Test
public void getConnectionTest() throws Exception {

    HostVO hostVo = setHostVoWithDetails();
    XenServerConnectionPool connPool = Mockito.mock(XenServerConnectionPool.class);
    Mockito.doReturn(conn).when(connPool).getConnect(Mockito.anyString(), Mockito.anyString(), Mockito.any(Queue.class));
    xenHypervisor.connPool = connPool;
    xenHypervisor.getConnection(hostVo);
    InOrder inOrder = Mockito.inOrder(xenHypervisor);
    inOrder.verify(xenHypervisor).getUsername(Mockito.anyMap());
    inOrder.verify(xenHypervisor).getPassword(Mockito.anyMap());
    Mockito.verify(connPool).getConnect(Mockito.anyString(), Mockito.anyString(), Mockito.any(Queue.class));
}