@Test
  public void testCustomCookies() throws Exception {

    // test if request interceptor adds custom cookies
    Map<String, String> additionalHeaders = new HashMap<>();
    Map<String, String> cookieHeaders = new HashMap<>();
    cookieHeaders.put("key1", "value1");
    cookieHeaders.put("key2", "value2");
    HttpBasicAuthInterceptorWithLogging authInt = openSessionWithTestInterceptor(additionalHeaders, cookieHeaders);
    assertTrue(authInt.hasCookieHeader());
    String cookieHeader = authInt.getCookieHeader();
    assertTrue(cookieHeader.contains("key1=value1"));
    assertTrue(cookieHeader.contains("key2=value2"));

    // test if request interceptor does not add empty Cookie header
    // when no custom cookies are defined
    Map<String, String> emptyCookieHeaders = new HashMap<>();
    HttpBasicAuthInterceptorWithLogging authInt2 = openSessionWithTestInterceptor(additionalHeaders, emptyCookieHeaders);
    assertFalse(authInt2.hasCookieHeader());
  }
Test additional http headers passed to request interceptor.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/service/cli/thrift/TestThriftHttpCLIServiceFeatures.java