use of com.linkedin.r2.message.timing.TimingContextUtil.TimingContext in project rest.li by linkedin.
the class TestSslTimingKey method testSslTimingKey.
@Test
public void testSslTimingKey() throws Exception {
if (isHttp2StreamBasedChannel())
return;
final EchoService client = new RestEchoClient(Bootstrap.createURI(_port, Bootstrap.getEchoURI(), true), createClient());
final String msg = "This is a simple http echo message";
final FutureCallback<String> callback = new FutureCallback<>();
client.echo(msg, callback);
Assert.assertEquals(callback.get(), msg);
RequestContext context = _clientCaptureFilter.getRequestContext();
@SuppressWarnings("unchecked") Map<TimingKey, TimingContext> map = (Map<TimingKey, TimingContext>) context.getLocalAttr("timings");
Assert.assertNotNull(map);
Assert.assertTrue(map.containsKey(SslHandshakeTimingHandler.TIMING_KEY));
TimingContext timingContext = map.get(SslHandshakeTimingHandler.TIMING_KEY);
Assert.assertNotNull(timingContext);
}
Aggregations