private void createTopologyLogicalRequest(Cluster cluster, String hostName) {
    Collection<HostRequest> hostRequests = new ArrayList<>();
    hostRequests.add(createHostRequest(1L, null));
    hostRequests.add(createHostRequest(2L, hostName));
    hostRequests.add(createHostRequest(3L, null));
    hostRequests.add(createHostRequest(4L, hostName + "2"));
    hostRequests.add(createHostRequest(5L, null));
    hostRequests.add(createHostRequest(6L, hostName + "3"));

    Long requestId = topologyRequestDAO.findByClusterId(cluster.getClusterId()).get(0).getId();
    LogicalRequest logicalRequest = createNiceMock(LogicalRequest.class);
    expect(logicalRequest.getHostRequests()).andReturn(hostRequests).anyTimes();
    expect(logicalRequest.getRequestContext()).andReturn("Description").anyTimes();
    expect(logicalRequest.getRequestId()).andReturn(1L).anyTimes();
    replay(logicalRequest);

    persistedState.persistLogicalRequest(logicalRequest, requestId);
  }
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