@Test
public void testMultiplePartitionsOnDifferentHosts() throws Exception {

    String host = "localhost";
    int port = 9092;
    int secondPort = 9093;
    int partition = 0;
    int secondPartition = partition + 1;
    addPartition(partition, 0, host, port);
    addPartition(secondPartition, 1, host, secondPort);
    GlobalPartitionInformation brokerInfo = dynamicBrokersReader.getBrokerInfo();
    assertEquals(2, brokerInfo.getOrderedPartitions().size());
    assertEquals(port, brokerInfo.getBrokerFor(partition).port);
    assertEquals(host, brokerInfo.getBrokerFor(partition).host);
    assertEquals(secondPort, brokerInfo.getBrokerFor(secondPartition).port);
    assertEquals(host, brokerInfo.getBrokerFor(secondPartition).host);
}