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);
}
Aggregations