@Test
public void testNewRequestId() throws Exception {
RequestIdProvider provider = new HttpRequestIdProvider("request_id", CORRELATOR);
ContextKeySupplier keySupplier = new MapBackedKeySupplier(new HashMap<String, String>());
AttributeMap attributeMap = new DefaultAttributeMap();
String requestId = provider.newRequestId(keySupplier, attributeMap);
ConcurrentLinkedQueue<String> ids = attributeMap.attr(HttpRequestIdProvider.REQUEST_IDS_KEY).get();
Assert.assertNotNull("Request Id not added to context.", ids);
Assert.assertNotNull("Request Id not added to context.", ids.peek());
Assert.assertSame("Unexpected request Id in the context.", requestId, ids.poll());
}