Skip to content

Commit

Permalink
Adapt to CompositeFuture changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed May 16, 2023
1 parent 9901a79 commit d562e1a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testWithSuccessfulCommands(TestContext tc) {
Future<Void> command2 = breaker.execute(commandThatWorks());
Future<Void> command3 = breaker.execute(commandThatWorks());

CompositeFuture.all(command1, command2, command3)
Future.all(command1, command2, command3)
.onComplete(ar -> {
assertThat(ar).succeeded();
assertThat(metrics())
Expand Down Expand Up @@ -107,7 +107,7 @@ public void testWithFailedCommands(TestContext tc) {
Future<Void> command3 = breaker.execute(commandThatWorks());
Future<Void> command4 = breaker.execute(commandThatFails());

CompositeFuture.join(command1, command2, command3, command4)
Future.join(command1, command2, command3, command4)
.onComplete(ar -> {
assertThat(metrics())
.contains("name", "some-circuit-breaker")
Expand Down Expand Up @@ -136,7 +136,7 @@ public void testWithCrashingCommands(TestContext tc) {
Future<Void> command4 = breaker.execute(commandThatFails());
Future<Void> command5 = breaker.execute(commandThatCrashes());

CompositeFuture.join(command1, command2, command3, command4, command5)
Future.join(command1, command2, command3, command4, command5)
.onComplete(ar -> {
assertThat(metrics())
.contains("name", "some-circuit-breaker")
Expand Down Expand Up @@ -165,7 +165,7 @@ public void testWithTimeoutCommands(TestContext tc) {
Future<Void> command4 = breaker.execute(commandThatFails());
Future<Void> command5 = breaker.execute(commandThatTimeout(100));

CompositeFuture.join(command1, command2, command3, command4, command5)
Future.join(command1, command2, command3, command4, command5)
.onComplete(ar -> {
assertThat(metrics())
.contains("name", "some-circuit-breaker")
Expand Down Expand Up @@ -194,7 +194,7 @@ public void testLatencyComputation(TestContext tc) {

IntStream.range(0, count)
.mapToObj(i -> breaker.execute(commandThatWorks()))
.collect(collectingAndThen(toList(), CompositeFuture::all))
.collect(collectingAndThen(toList(), Future::all))
.onComplete(ar -> {
assertThat(ar).succeeded();
assertThat(metrics())
Expand Down Expand Up @@ -228,7 +228,7 @@ public void testEviction(TestContext tc) {
list.add(breaker.execute(commandThatWorks()));
}

CompositeFuture.all(list)
Future.all(list)
.onComplete(ar -> {
assertThat(ar).succeeded();
assertThat(metrics().getInteger("totalOperationCount")).isEqualTo(1000);
Expand Down

0 comments on commit d562e1a

Please sign in to comment.