Search in sources :

Example 1 with HttpRequestFilter

use of com.facebook.airlift.http.client.HttpRequestFilter in project presto by prestodb.

the class TestGenerateTokenFilter method setup.

@BeforeClass
public void setup() throws Exception {
    server = new TestingPrestoServer(ImmutableList.of(new TestGenerateTokenFilterModule()));
    httpClient = (JettyHttpClient) server.getInstance(Key.get(HttpClient.class, GenerateTokenFilterTest.class));
    // extract the filter
    List<HttpRequestFilter> filters = httpClient.getRequestFilters();
    assertEquals(filters.size(), 2);
    assertInstanceOf(filters.get(1), GenerateTraceTokenRequestFilter.class);
    filter = (GenerateTraceTokenRequestFilter) filters.get(1);
}
Also used : HttpRequestFilter(com.facebook.airlift.http.client.HttpRequestFilter) JettyHttpClient(com.facebook.airlift.http.client.jetty.JettyHttpClient) HttpClient(com.facebook.airlift.http.client.HttpClient) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

HttpClient (com.facebook.airlift.http.client.HttpClient)1 HttpRequestFilter (com.facebook.airlift.http.client.HttpRequestFilter)1 JettyHttpClient (com.facebook.airlift.http.client.jetty.JettyHttpClient)1 TestingPrestoServer (com.facebook.presto.server.testing.TestingPrestoServer)1 BeforeClass (org.testng.annotations.BeforeClass)1