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 9785b7716..ce42d8ee6 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 @@ -511,9 +511,6 @@ public void testEnableMessageOrdering_overwritesMaxAttempts() throws Exception { *
  • publish with key orderA, which should now succeed * */ - /* - Temporarily disabled due to https://github.com/googleapis/java-pubsub/issues/1861. - TODO(maitrimangal): Enable once resolved. @Test public void testResumePublish() throws Exception { Publisher publisher = @@ -575,8 +572,8 @@ public void testResumePublish() throws Exception { testPublisherServiceImpl.addPublishResponse( PublishResponse.newBuilder().addMessageIds("5").addMessageIds("6")); - Assert.assertEquals("5", future5.get()); - Assert.assertEquals("6", future6.get()); + assertEquals("5", future5.get()); + assertEquals("6", future6.get()); // Resume publishing of "orderA", which should now succeed publisher.resumePublish("orderA"); @@ -587,8 +584,8 @@ public void testResumePublish() throws Exception { testPublisherServiceImpl.addPublishResponse( PublishResponse.newBuilder().addMessageIds("7").addMessageIds("8")); - Assert.assertEquals("7", future7.get()); - Assert.assertEquals("8", future8.get()); + assertEquals("7", future7.get()); + assertEquals("8", future8.get()); shutdownTestPublisher(publisher); } @@ -633,6 +630,7 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E } catch (ExecutionException e) { assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } + fakeExecutor.advanceTime(Duration.ZERO); // A subsequent attempt fails immediately. ApiFuture publishFuture4 = sendTestMessageWithOrderingKey(publisher, "D", "a"); @@ -643,7 +641,6 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } } - */ private ApiFuture sendTestMessageWithOrderingKey( Publisher publisher, String data, String orderingKey) {