Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions framework-platform/framework-platform.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ dependencies {
api("org.hibernate.orm:hibernate-core:7.4.5.Final")
api("org.hibernate.validator:hibernate-validator:9.1.3.Final")
api("org.hsqldb:hsqldb:2.7.4")
api("org.htmlunit:htmlunit:4.21.0")
api("org.htmlunit:htmlunit:5.4.0")
api("org.javamoney:moneta:1.4.4")
api("org.jboss.logging:jboss-logging:3.6.1.Final")
api("org.jruby:jruby:10.0.2.0")
Expand All @@ -134,8 +134,8 @@ dependencies {
api("org.python:jython-standalone:2.7.4")
api("org.quartz-scheduler:quartz:2.3.2")
api("org.reactivestreams:reactive-streams:1.0.4")
api("org.seleniumhq.selenium:htmlunit3-driver:4.41.0")
api("org.seleniumhq.selenium:selenium-java:4.41.0")
api("org.seleniumhq.selenium:htmlunit3-driver:4.47.0")
api("org.seleniumhq.selenium:selenium-java:4.47.0")
api("org.skyscreamer:jsonassert:1.5.3")
api("org.testng:testng:7.12.0")
api("org.webjars:webjars-locator-lite:1.1.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ private void cookies(MockHttpServletRequest request) {
}
}

Set<org.htmlunit.util.Cookie> managedCookies = this.webClient.getCookies(this.webRequest.getUrl());
for (org.htmlunit.util.Cookie cookie : managedCookies) {
Set<org.htmlunit.http.Cookie> managedCookies = this.webClient.getCookies(this.webRequest.getUrl());
for (org.htmlunit.http.Cookie cookie : managedCookies) {
processCookie(request, cookies, new Cookie(cookie.getName(), cookie.getValue()));
}

Expand Down Expand Up @@ -343,8 +343,8 @@ private void removeSessionCookie(MockHttpServletRequest request, String sessioni
this.webClient.getCookieManager().removeCookie(createCookie(request, sessionid));
}

private org.htmlunit.util.Cookie createCookie(MockHttpServletRequest request, String sessionid) {
return new org.htmlunit.util.Cookie(request.getServerName(), "JSESSIONID", sessionid,
private org.htmlunit.http.Cookie createCookie(MockHttpServletRequest request, String sessionid) {
return new org.htmlunit.http.Cookie(request.getServerName(), "JSESSIONID", sessionid,
request.getContextPath() + "/", null, request.isSecure(), true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.http.impl.cookie.BasicClientCookie;
import org.htmlunit.CookieManager;
import org.htmlunit.WebClient;
import org.htmlunit.WebConnection;
import org.htmlunit.WebRequest;
import org.htmlunit.WebResponse;
import org.htmlunit.util.Cookie;
import org.htmlunit.http.Cookie;
import org.jspecify.annotations.Nullable;

import org.springframework.mock.web.MockHttpServletResponse;
Expand Down Expand Up @@ -179,22 +178,13 @@ private void storeCookies(WebRequest webRequest, jakarta.servlet.http.Cookie[] c
}
}

@SuppressWarnings("removal")
private static Cookie createCookie(jakarta.servlet.http.Cookie cookie) {
Date expires = null;
if (cookie.getMaxAge() > -1) {
expires = new Date(System.currentTimeMillis() + cookie.getMaxAge() * 1000);
}
BasicClientCookie result = new BasicClientCookie(cookie.getName(), cookie.getValue());
result.setDomain(cookie.getDomain());
result.setComment(cookie.getComment());
result.setExpiryDate(expires);
result.setPath(cookie.getPath());
result.setSecure(cookie.getSecure());
if (cookie.isHttpOnly()) {
result.setAttribute("httponly", "true");
}
return new Cookie(result);
return new Cookie(cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(),
expires, cookie.getSecure(), cookie.isHttpOnly());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ void mergeDoesNotCorruptPathInfoOnParent() throws Exception {


private void assertSingleSessionCookie(String expected) {
org.htmlunit.util.Cookie jsessionidCookie = webClient.getCookieManager().getCookie("JSESSIONID");
org.htmlunit.http.Cookie jsessionidCookie = webClient.getCookieManager().getCookie("JSESSIONID");
if (expected == null || expected.contains("Expires=Thu, 01-Jan-1970 00:00:01 GMT")) {
assertThat(jsessionidCookie).isNull();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.htmlunit.WebClient;
import org.htmlunit.WebRequest;
import org.htmlunit.WebResponse;
import org.htmlunit.util.Cookie;
import org.htmlunit.http.Cookie;
import org.junit.jupiter.api.Test;

import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.springframework.test.web.servlet.htmlunit.webdriver;

import jakarta.servlet.http.HttpServletRequest;
import org.htmlunit.util.Cookie;
import org.htmlunit.http.Cookie;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

Expand Down