From e8dbbe8bdd0dcc2323b87869860a51633fcf96f3 Mon Sep 17 00:00:00 2001 From: Bipinkumar27 Date: Wed, 13 Sep 2023 22:15:11 +0530 Subject: [PATCH] JAVA-23970: fixes made for Update article "Get Cookies From the Apache HttpClient Response" --- .../cookies/HttpClientGettingCookieValueUnitTest.java | 5 +++-- apache-httpclient-2/src/test/resources/logback.xml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apache-httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java b/apache-httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java index ef57406705..6a8308483b 100644 --- a/apache-httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java +++ b/apache-httpclient-2/src/test/java/com/baeldung/httpclient/cookies/HttpClientGettingCookieValueUnitTest.java @@ -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; diff --git a/apache-httpclient-2/src/test/resources/logback.xml b/apache-httpclient-2/src/test/resources/logback.xml index 366a94e86e..dc1bbea439 100644 --- a/apache-httpclient-2/src/test/resources/logback.xml +++ b/apache-httpclient-2/src/test/resources/logback.xml @@ -4,6 +4,7 @@ %date [%level] %logger - %msg %n +