@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); }
@Test public void shouldThrowExceptionIfPartitionsCountIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setPartitionsCount(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Partition count must not be smaller then 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfReplicationFactorIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setReplicationFactor(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Replication factor -1 needs to be larger then zero and not larger then cluster size 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfNodeIdIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setNodeId(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Node id -1 needs to be non negative and smaller then cluster size 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfNodeIdIsLargerThenClusterSize() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setNodeId(2); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Node id 2 needs to be non negative and smaller then cluster size 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfPartitionsCountIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setPartitionsCount(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Partition count must not be smaller then 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfNodeIdIsLargerThenClusterSize() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setNodeId(2); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Node id 2 needs to be non negative and smaller then cluster size 1."); initSystemContext(brokerCfg); }
@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); }
@Test public void shouldThrowExceptionIfReplicationFactorIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setReplicationFactor(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Replication factor -1 needs to be larger then zero and not larger then cluster size 1."); initSystemContext(brokerCfg); }
@Test public void shouldThrowExceptionIfNodeIdIsNegative() { // given final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getCluster().setNodeId(-1); // expect expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Node id -1 needs to be non negative and smaller then cluster size 1."); initSystemContext(brokerCfg); }