@@ -0,0 +1,1828 @@
+/*-%0A * -%5C-%5C-%0A * async-google-pubsub-client%0A * --%0A * Copyright (C) 2016 - 2017 Spotify AB%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 * -/-/-%0A */%0A%0Apackage com.spotify.google.cloud.pubsub.client;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.io.IOException;%0Aimport java.util.concurrent.ExecutionException;%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.concurrent.TimeoutException;%0Aimport org.hamcrest.Matchers;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class PubsubFutureTest %7B%0A%0A  @Rule public ExpectedException exception = ExpectedException.none();%0A%0A  @Mock RequestInfo requestInfo;%0A%0A  @Test%0A  public void testToCompletableFutureErrorPropagation() throws Exception %7B%0A    final PubsubFuture%3CVoid%3E f1 = new PubsubFuture%3C%3E(requestInfo);%0A    final PubsubFuture%3CVoid%3E f2 = f1.toCompletableFuture();%0A%0A    final Exception cause = new Exception();%0A%0A    f1.fail(cause);%0A%0A    assertThat(f2.isDone(), is(true));%0A    assertThat(f2.isCompletedExceptionally(), is(true));%0A%0A    exception.expectCause(is(cause));%0A%0A    f2.get();%0A  %7D%0A%7D

add failing test