  @Test
  public void shouldThrowExceptionIfReplicationFactorIsLargerThenClusterSize() {

    // given
    final BrokerCfg brokerCfg = new BrokerCfg();
    brokerCfg.getCluster().setReplicationFactor(2);

    // expect
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage(
        "Replication factor 2 needs to be larger then zero and not larger then cluster size 1.");

    initSystemContext(brokerCfg);
  }