use of io.grpc.internal.StreamListener.MessageProducer in project grpc-java by grpc.
the class RetriableStreamTest method messageAvailable.
@Test
public void messageAvailable() {
ClientStream mockStream1 = mock(ClientStream.class);
doReturn(mockStream1).when(retriableStreamRecorder).newSubstream(0);
retriableStream.start(masterListener);
ArgumentCaptor<ClientStreamListener> sublistenerCaptor1 = ArgumentCaptor.forClass(ClientStreamListener.class);
verify(mockStream1).start(sublistenerCaptor1.capture());
ClientStreamListener listener = sublistenerCaptor1.getValue();
listener.headersRead(new Metadata());
MessageProducer messageProducer = mock(MessageProducer.class);
listener.messagesAvailable(messageProducer);
verify(masterListener).messagesAvailable(messageProducer);
}
use of io.grpc.internal.StreamListener.MessageProducer in project grpc-java by grpc.
the class ForwardingClientStreamListenerTest method messagesAvailableTest.
@Test
public void messagesAvailableTest() {
MessageProducer producer = mock(MessageProducer.class);
forward.messagesAvailable(producer);
verify(mock).messagesAvailable(same(producer));
}
Aggregations