Search in sources :

Example 1 with TransportChannel

use of com.google.api.gax.rpc.TransportChannel in project spring-cloud-gcp by GoogleCloudPlatform.

the class DefaultPublisherFactoryTests method setUp.

@BeforeEach
public void setUp() throws IOException {
    factory = new DefaultPublisherFactory(() -> "projectId");
    factory.setCredentialsProvider(NoCredentialsProvider.create());
    TransportChannelProvider mockChannelProvider = mock(TransportChannelProvider.class);
    TransportChannel mockTransportChannel = mock(TransportChannel.class);
    when(mockChannelProvider.getTransportChannel()).thenReturn(mockTransportChannel);
    ApiCallContext mockContext = mock(ApiCallContext.class);
    when(mockTransportChannel.getEmptyCallContext()).thenReturn(mockContext);
    when(mockContext.withTransportChannel(any())).thenReturn(mockContext);
    factory.setChannelProvider(mockChannelProvider);
}
Also used : TransportChannel(com.google.api.gax.rpc.TransportChannel) ApiCallContext(com.google.api.gax.rpc.ApiCallContext) TransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ApiCallContext (com.google.api.gax.rpc.ApiCallContext)1 TransportChannel (com.google.api.gax.rpc.TransportChannel)1 TransportChannelProvider (com.google.api.gax.rpc.TransportChannelProvider)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1