@Test public void getRequestSentThroughHeader() { MethodDescriptor<?, ?> descriptor = MethodDescriptor.<Void, Void>newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("testService/test") .setRequestMarshaller(marshaller) .setResponseMarshaller(marshaller) .setIdempotent(true) .setSafe(true) .build(); NettyClientStream stream = new NettyClientStream( new TransportStateImpl(handler, DEFAULT_MAX_MESSAGE_SIZE), descriptor, new Metadata(), channel, AsciiString.of("localhost"), AsciiString.of("http"), AsciiString.of("agent"), StatsTraceContext.NOOP, transportTracer, CallOptions.DEFAULT); stream.start(listener); stream.transportState().setId(STREAM_ID); stream.transportState().setHttp2Stream(http2Stream); byte[] msg = smallMessage(); stream.writeMessage(new ByteArrayInputStream(msg)); stream.flush(); stream.halfClose(); ArgumentCaptor<CreateStreamCommand> cmdCap = ArgumentCaptor.forClass(CreateStreamCommand.class); verify(writeQueue).enqueue(cmdCap.capture(), eq(true)); ImmutableListMultimap<CharSequence, CharSequence> headers = ImmutableListMultimap.copyOf(cmdCap.getValue().headers()); assertThat(headers).containsEntry(AsciiString.of(":method"), Utils.HTTP_GET_METHOD); assertThat(headers) .containsEntry( AsciiString.of(":path"), AsciiString.of("/testService/test?" + BaseEncoding.base64().encode(msg))); }
@Override protected TransportState transportState() { return state; }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); @Override void setAuthority(String authority); @Override Attributes getAttributes(); }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); @Override void setAuthority(String authority); @Override Attributes getAttributes();  }