com.qa.framework.library.httpclient.CookieCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smart-api-framework Show documentation
Show all versions of smart-api-framework Show documentation
Support web service api automaton test based on testng and httpclient
package com.qa.framework.library.httpclient;
import org.apache.http.client.CookieStore;
/**
* Created by apple on 15/11/9.
*/
public class CookieCache {
private static ThreadLocal cookieStoreThreadLocal = new ThreadLocal();
/**
* Set.
*
* @param cookie the cookie
*/
public static void set(CookieStore cookie) {
cookieStoreThreadLocal.set(cookie);
}
/**
* Get cookie store.
*
* @return the cookie store
*/
public static CookieStore get() {
return cookieStoreThreadLocal.get();
}
/**
* Clear.
*/
public static void clear() {
set(null);
}
}