@@ -0,0 +1,1899 @@
+/*%0A * Copyright %C2%A9 2018 Knative Authors (knative-dev@googlegroups.com)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage dev.knative.eventing.kafka.broker.core;%0A%0Aimport io.vertx.core.Future;%0Aimport io.vertx.core.Vertx;%0Aimport io.vertx.junit5.VertxExtension;%0Aimport io.vertx.junit5.VertxTestContext;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.ExtendWith;%0A%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A@ExtendWith(VertxExtension.class)%0Apublic class AsyncCloseableTest %7B%0A%0A  @Test%0A  public void compose(final VertxTestContext context) %7B%0A    final var x = new AtomicInteger(0);%0A    final var y = new AtomicInteger(0);%0A    final var z = new AtomicInteger(0);%0A    final var closeable = AsyncCloseable.compose(%0A      () -%3E %7B%0A        x.incrementAndGet();%0A        return Future.succeededFuture();%0A      %7D,%0A      () -%3E %7B%0A        y.incrementAndGet();%0A        return Future.failedFuture(new RuntimeException());%0A      %7D,%0A      () -%3E %7B%0A        z.incrementAndGet();%0A        return Future.succeededFuture();%0A      %7D%0A    );%0A%0A    closeable.close()%0A      .onSuccess(v -%3E context.verify(() -%3E %7B%0A        assertThat(x.get()).isEqualTo(1);%0A        assertThat(y.get()).isEqualTo(1);%0A        assertThat(z.get()).isEqualTo(1);%0A        context.completeNow();%0A      %7D))%0A      .onFailure(context::failNow);%0A  %7D%0A%7D%0A

Add unit test for AsyncCloseable's compose utility (#2146)