@Test public void should_add_bandwidth_with_iterations() throws Exception { networkChaos .on("hw", 8080) .bandwidth(rate(1000)) .exec( times(3), () -> { getResponse(); }); }
@Test public void should_add_timeout() throws Exception { thrown.expect(SocketException.class); thrown.expectMessage("Unexpected end of file from server"); networkChaos .on("hw", 8080) .timeout(timeoutInMillis(1000)) .exec( () -> { getResponse(); }); }
@Test public void should_add_log_normal_latency_and_bandwidth_with_iterations() throws Exception { NetworkChaos.Action chaosAction = networkChaos.on("hw", 8080); chaosAction.bandwidth(NetworkChaos.DistributedRateType.logNormalLatencyInMillis(3000, 0.2)); chaosAction.latency(logNormalLatencyInMillis(2000, 0.3)); chaosAction.exec( times(3), () -> { getResponse(); }); }