From 946aab854c3b528767078c38dcea8e3a86659078 Mon Sep 17 00:00:00 2001 From: lprimak Date: Fri, 22 Sep 2023 19:23:33 -0500 Subject: [PATCH 1/2] bugfix(ITs): standalone deployment of Jakarta EE test app actually works now --- integration-tests/jakarta-ee/pom.xml | 1 - .../jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml | 1 + .../jakarta-ee/src/main/webapp/WEB-INF/web.xml | 4 ++++ .../org/apache/shiro/ee/filters/FormResubmitSupport.java | 9 ++++----- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/integration-tests/jakarta-ee/pom.xml b/integration-tests/jakarta-ee/pom.xml index 620f368514..eec2a70bb2 100644 --- a/integration-tests/jakarta-ee/pom.xml +++ b/integration-tests/jakarta-ee/pom.xml @@ -153,7 +153,6 @@ com.flowlogix flowlogix-jee 5.5.2 - test diff --git a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml index 95cd0a3d51..e66c141a19 100644 --- a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml +++ b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml @@ -30,5 +30,6 @@ org.omnifaces.resourcehandler.VersionedResourceHandler + org.omnifaces.resourcehandler.UnmappedResourceHandler diff --git a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml index f2d6b867d2..0e1c1ab45c 100644 --- a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml +++ b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml @@ -58,6 +58,10 @@ org.omnifaces.FACES_VIEWS_SCAN_PATHS /*.xhtml + + com.flowlogix.add-unmapped-resources + true + org.apache.shiro.ee.disabled false diff --git a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java index cd44ced4ce..8ef3c8e39a 100644 --- a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java +++ b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java @@ -38,7 +38,6 @@ import java.net.CookieManager; import java.net.HttpCookie; import java.net.URI; -import java.net.URISyntaxException; import java.net.URLDecoder; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -240,7 +239,7 @@ static String getReferer(HttpServletRequest request) { * @param fallbackPath * @param resubmit if true, attempt to resubmit the form that was unsubmitted prior to logout */ - @SneakyThrows({IOException.class, URISyntaxException.class, InterruptedException.class}) + @SneakyThrows({IOException.class, InterruptedException.class}) static void redirectToSaved(HttpServletRequest request, HttpServletResponse response, FallbackPredicate useFallbackPath, String fallbackPath, boolean resubmit) { String savedRequest = Servlets.getRequestCookie(request, WebUtils.SAVED_REQUEST_KEY); @@ -268,7 +267,7 @@ static void redirectToSaved(HttpServletRequest request, HttpServletResponse resp private static void doRedirectToSaved(HttpServletRequest request, HttpServletResponse response, - @NonNull String savedRequest, boolean resubmit) throws IOException, URISyntaxException, InterruptedException { + @NonNull String savedRequest, boolean resubmit) throws IOException, InterruptedException { deleteCookie(response, request.getServletContext(), WebUtils.SAVED_REQUEST_KEY); String savedFormDataKey = Servlets.getRequestCookie(request, SHIRO_FORM_DATA_KEY); boolean doRedirectAtEnd = true; @@ -358,7 +357,7 @@ static boolean isLoginUrl(HttpServletRequest request) { static String resubmitSavedForm(@NonNull String savedFormData, @NonNull String savedRequest, HttpServletRequest originalRequest, HttpServletResponse originalResponse, ServletContext servletContext, boolean rememberedAjaxResubmit) - throws InterruptedException, URISyntaxException, IOException { + throws InterruptedException, IOException { if (log.isDebugEnabled()) { log.debug("saved form data: {}", savedFormData); log.debug("Set Cookie Headers: {}", originalResponse.getHeaders(SET_COOKIE)); @@ -477,7 +476,7 @@ private static String resubmitResponseCleanup(HttpServletRequest originalRequest } private static HttpClient buildHttpClient(URI savedRequest, ServletContext servletContext, - HttpServletRequest originalRequest) throws URISyntaxException { + HttpServletRequest originalRequest) { CookieManager cookieManager = new CookieManager(); var session = SecurityUtils.getSubject().getSession(); var sessionCookieName = getSessionCookieName(servletContext, SecurityUtils.getSecurityManager()); From f1889f811d909f074f279a6606655aa3c07380a3 Mon Sep 17 00:00:00 2001 From: lprimak Date: Fri, 22 Sep 2023 20:27:38 -0500 Subject: [PATCH 2/2] enh: Compiles on JDK 21. Fixes #1077 --- integration-tests/jakarta-ee/pom.xml | 24 ++++++++++++------- .../org.mockito.plugins.MockMaker | 1 + pom.xml | 23 ++++++++++++++++-- support/cdi/pom.xml | 19 +++++++++------ support/jakarta-ee/pom.xml | 19 +++++++++------ 5 files changed, 62 insertions(+), 24 deletions(-) create mode 100644 integration-tests/jakarta-ee/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/integration-tests/jakarta-ee/pom.xml b/integration-tests/jakarta-ee/pom.xml index eec2a70bb2..fc0d2ebfc2 100644 --- a/integration-tests/jakarta-ee/pom.xml +++ b/integration-tests/jakarta-ee/pom.xml @@ -37,6 +37,8 @@ ${maven.compiler.release} ${maven.compiler.release} 1.7.1.Final + 2.5.6 + 2.5.4 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED @@ -137,12 +139,6 @@ 2.1.6 test - - org.mockito - mockito-inline - ${mockito-inline.version} - test - org.slf4j slf4j-jdk14 @@ -185,7 +181,7 @@ org.jboss.arquillian.graphene graphene-webdriver - 2.5.4 + ${arquillian.graphene.version} test pom @@ -203,7 +199,7 @@ org.jboss.arquillian.extension arquillian-drone-bom - 2.5.6 + ${arquillian.drone.version} pom import @@ -219,6 +215,18 @@ + + maven-compiler-plugin + + + + org.projectlombok + lombok + ${lombok.version} + + + + maven-war-plugin diff --git a/integration-tests/jakarta-ee/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/integration-tests/jakarta-ee/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000..1f0955d450 --- /dev/null +++ b/integration-tests/jakarta-ee/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline diff --git a/pom.xml b/pom.xml index 8db536b20d..de622df3f9 100644 --- a/pom.xml +++ b/pom.xml @@ -119,9 +119,9 @@ 5.2.0 5.5.0 - 5.2.0 + 1.14.8 3.0.0 - 4.0.13 + 4.0.15 5.10.0 3.0.0 5.6.15.Final @@ -343,6 +343,7 @@ **/target/** **/nb-configuration.xml **/faces-config.NavData + **/org.mockito.plugins.MockMaker @@ -606,6 +607,13 @@ -Xlint:deprecation -Xlint:unchecked + + + org.aspectj + aspectjweaver + ${aspectj.version} + + @@ -1075,6 +1083,16 @@ 2.1.0 test + + net.bytebuddy + byte-buddy + ${bytebuddy.version} + + + net.bytebuddy + byte-buddy-agent + ${bytebuddy.version} + commons-cli @@ -1542,6 +1560,7 @@ **/target/** **/nb-configuration.xml **/faces-config.NavData + **/org.mockito.plugins.MockMaker diff --git a/support/cdi/pom.xml b/support/cdi/pom.xml index 5c6863194d..693f02a9d5 100644 --- a/support/cdi/pom.xml +++ b/support/cdi/pom.xml @@ -68,13 +68,6 @@ test true - - org.mockito - mockito-inline - ${mockito-inline.version} - test - true - org.slf4j slf4j-jdk14 @@ -86,6 +79,18 @@ + + maven-compiler-plugin + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.apache.felix maven-bundle-plugin diff --git a/support/jakarta-ee/pom.xml b/support/jakarta-ee/pom.xml index 07f4eca68c..a70625860c 100644 --- a/support/jakarta-ee/pom.xml +++ b/support/jakarta-ee/pom.xml @@ -87,13 +87,6 @@ test true - - org.mockito - mockito-inline - ${mockito-inline.version} - test - true - org.slf4j slf4j-jdk14 @@ -105,6 +98,18 @@ + + maven-compiler-plugin + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.apache.felix maven-bundle-plugin