Search in sources :

Example 36 with Subscriber

use of com.google.cloud.pubsub.spi.v1.Subscriber in project spring-cloud-gcp by spring-cloud.

the class PubSubTemplateTests method testSubscribe.

@Test
public void testSubscribe() {
    Subscriber subscriber = this.pubSubTemplate.subscribe("testSubscription", (message) -> {
    });
    assertThat(subscriber).isEqualTo(this.mockSubscriber);
    verify(this.mockSubscriber, times(1)).startAsync();
}
Also used : Subscriber(com.google.cloud.pubsub.v1.Subscriber) Test(org.junit.Test)

Aggregations

Subscriber (com.google.cloud.pubsub.v1.Subscriber)25 ProjectSubscriptionName (com.google.pubsub.v1.ProjectSubscriptionName)13 ArrayList (java.util.ArrayList)9 List (java.util.List)9 Test (org.junit.Test)9 SettableApiFuture (com.google.api.core.SettableApiFuture)8 ServiceOptions (com.google.cloud.ServiceOptions)8 DlpServiceClient (com.google.cloud.dlp.v2.DlpServiceClient)8 Action (com.google.privacy.dlp.v2.Action)8 BigQueryTable (com.google.privacy.dlp.v2.BigQueryTable)8 CreateDlpJobRequest (com.google.privacy.dlp.v2.CreateDlpJobRequest)8 DlpJob (com.google.privacy.dlp.v2.DlpJob)8 GetDlpJobRequest (com.google.privacy.dlp.v2.GetDlpJobRequest)8 InfoType (com.google.privacy.dlp.v2.InfoType)8 ProjectName (com.google.privacy.dlp.v2.ProjectName)8 ProjectTopicName (com.google.pubsub.v1.ProjectTopicName)8 Collections (java.util.Collections)8 TimeUnit (java.util.concurrent.TimeUnit)8 CommandLine (org.apache.commons.cli.CommandLine)8 CommandLineParser (org.apache.commons.cli.CommandLineParser)8