diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java index 5ee5fdcfc..c68367601 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java @@ -153,8 +153,7 @@ public void testPublishByNumBatchedMessages() throws Exception { assertFalse(publishFuture3.isDone()); - ApiFuture publishFuture4 = - publisher.publish(PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("D")).build()); + ApiFuture publishFuture4 = sendTestMessage(publisher, "D"); assertEquals("3", publishFuture3.get()); assertEquals("4", publishFuture4.get());