Merge pull request #14760 from Bipinkumar27/JAVA-23970
JAVA-23970: fixes made for Update article "Get Cookies From the Apach…
This commit is contained in:
commit
3d4080b6bc
|
@ -14,6 +14,7 @@ import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
|
|||
import org.apache.hc.client5.http.impl.cookie.BasicClientCookie;
|
||||
import org.apache.hc.client5.http.protocol.HttpClientContext;
|
||||
|
||||
import org.apache.http.cookie.ClientCookie;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -51,8 +52,8 @@ class HttpClientGettingCookieValueUnitTest {
|
|||
private BasicCookieStore createCustomCookieStore() {
|
||||
BasicCookieStore cookieStore = new BasicCookieStore();
|
||||
BasicClientCookie cookie = new BasicClientCookie("custom_cookie", "test_value");
|
||||
cookie.setDomain("baeldung.com");
|
||||
cookie.setAttribute("domain", "true");
|
||||
cookie.setDomain("github.com");
|
||||
cookie.setAttribute(ClientCookie.DOMAIN_ATTR, "github.com");
|
||||
cookie.setPath("/");
|
||||
cookieStore.addCookie(cookie);
|
||||
return cookieStore;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<pattern>%date [%level] %logger - %msg %n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="com.baeldung.httpclient.cookies" level="info"/>
|
||||
|
||||
<logger name="com.baeldung.httpclient.readresponsebodystring" level="debug"/>
|
||||
<logger name="org.apache.http" level="debug"/>
|
||||
|
|
Loading…
Reference in New Issue