TankHttpClient4 implements TankHttpClient { @Override public void clearSession() { context.getCookieStore().clear(); } TankHttpClient4(); Object createHttpClient(); void setHttpClient(Object httpClient); void setConnectionTimeout(long connectionTimeout); @Override void doGet(BaseRequest request); @Override void doPut(BaseRequest request); @Override void doDelete(BaseRequest request); @Override void doOptions(BaseRequest request); @Override void doPost(BaseRequest request); @Override void addAuth(AuthCredentials creds); @Override void clearSession(); @Override void setCookie(TankCookie tankCookie); @Override void setProxy(String proxyhost, int proxyport);  }
@Test @Tag(TestGroups.FUNCTIONAL) public void clearSession() { BaseRequest request = getRequest(new TankHttpClient4(), "http: request.getHttpclient().setCookie(TankCookie.builder().withName("test-cookie").withValue("test-value").withDomain("httpbin.org").withPath("/").build()); request.doGet(null); BaseResponse response = request.getResponse(); assertNotNull(response); assertEquals(200, response.getHttpCode()); assertTrue(response.getBody().contains("test-cookie")); request.getHttpclient().clearSession(); request.doGet(null); response = request.getResponse(); assertNotNull(response); assertEquals(200, response.getHttpCode()); assertTrue(!response.getBody().contains("test-cookie")); }