private HostRequest createHostRequest(long hrId, String hostName) {
    HostRequest hr = createNiceMock(HostRequest.class);
    expect(hr.getId()).andReturn(hrId).anyTimes();
    expect(hr.getHostgroupName()).andReturn("MyHostGroup").anyTimes();
    expect(hr.getHostName()).andReturn(hostName).anyTimes();
    expect(hr.getStageId()).andReturn(1L);
    expect(hr.getTopologyTasks()).andReturn(Collections.emptyList());

    replay(hr);
    return hr;
  }
Tests that {@link HostRegisteredEvent} properly updates the
{@link Clusters} in-memory mapping of hostIds to hosts.

@throws AmbariException
ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java