Skip to content

Commit

Permalink
fix: Attempt to start the publisher and publish in the ITVPC test (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
palmere-google committed Dec 11, 2020
1 parent 0c0d928 commit 8ebc9f1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.google.cloud.pubsublite.proto.Topic.RetentionConfig;
import com.google.protobuf.FieldMask;
import com.google.protobuf.util.Durations;
import com.google.pubsub.v1.PubsubMessage;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -320,9 +321,16 @@ public void deniedPublish() {
PublisherSettings.newBuilder().setTopicPath(topicPath).build();

Publisher publisher = Publisher.create(publisherSettings);
publisher.startAsync().awaitRunning();
publisher.publish(PubsubMessage.newBuilder().build());
publisher.awaitTerminated(30, TimeUnit.SECONDS);
fail("Expected PERMISSION_DENIED CheckedApiException");
} catch (ApiException e) {
checkExceptionForVPCError(new CheckedApiException(e));
} catch (TimeoutException t) {
fail("Expected PERMISSION_DENIED CheckedApiException but got: " + t.toString());
} catch (IllegalStateException e) {
checkExceptionForVPCError(toCanonical(e.getCause()));
}
}

Expand Down

0 comments on commit 8ebc9f1

Please sign in to comment.