@Test
public void getHosts()
    throws HMSRestException
{

    ServerNodeConnector.getInstance().setNodeMap( new ConcurrentHashMap<String, HmsNode>() );
    insertNodeInNodeMap( getServerNode() );
    ServerRestService restService = new ServerRestService();
    Map<String, HmsNode> hostMap = restService.getHosts();
    Set<Entry<String, HmsNode>> nodeEntrySet = hostMap.entrySet();
    if ( nodeEntrySet != null && nodeEntrySet.size() > 0 )
    {
        Iterator<Entry<String, HmsNode>> itr = nodeEntrySet.iterator();
        while ( itr.hasNext() )
        {
            Entry<String, HmsNode> curItem = itr.next();
            ServerNode servNode = (ServerNode) curItem.getValue();
            assertEquals( servNode.getNodeID(), "N1" );
            assertEquals( servNode.getBoardProductName(), "S2600GZ" );
            assertEquals( servNode.getBoardVendor(), "Intel" );
            assertEquals( servNode.getIbIpAddress(), "10.28.197.28" );
            assertEquals( servNode.getManagementIp(), "10.28.197.208" );
            assertEquals( servNode.getOsUserName(), "testuser" );
            assertEquals( servNode.getOsPassword(), "****" );
        }
    }
    nodeEntrySet = ServerNodeConnector.getInstance().getNodeMap().entrySet();
    if ( nodeEntrySet != null && nodeEntrySet.size() > 0 )
    {
        Iterator<Entry<String, HmsNode>> itr = nodeEntrySet.iterator();
        while ( itr.hasNext() )
        {
            Entry<String, HmsNode> curItem = itr.next();
            ServerNode servNode = (ServerNode) curItem.getValue();
            assertEquals( servNode.getNodeID(), "N1" );
            assertEquals( servNode.getBoardProductName(), "S2600GZ" );
            assertEquals( servNode.getBoardVendor(), "Intel" );
            assertEquals( servNode.getIbIpAddress(), "10.28.197.28" );
            assertEquals( servNode.getManagementIp(), "10.28.197.208" );
            assertEquals( servNode.getOsUserName(), "testuser" );
            assertEquals( servNode.getOsPassword(), "password" );
        }
    }
}