diff --git a/.gitignore b/.gitignore index 93b4fba2..74223ea6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ /*.iml .idea .springBeans +.DS_Store overlays diff --git a/NOTICE b/NOTICE index bdac0a71..f5e06cae 100644 --- a/NOTICE +++ b/NOTICE @@ -23,10 +23,9 @@ This project includes: Apache Ant Launcher under The Apache Software License, Version 2.0 Apache Commons CLI under Apache License, Version 2.0 Apache Commons Codec under Apache License, Version 2.0 - Apache Commons Compress under Apache License, Version 2.0 + Apache Commons Compress under Apache-2.0 Apache Commons IO under Apache License, Version 2.0 Apache Commons Lang under Apache License, Version 2.0 - Apache Commons Logging under The Apache Software License, Version 2.0 Apache Commons Math under Apache License, Version 2.0 Apache Commons Pool under Apache License, Version 2.0 Apache Groovy under The Apache Software License, Version 2.0 @@ -42,19 +41,24 @@ This project includes: Byte Buddy (without dependencies) under Apache License, Version 2.0 Byte Buddy agent under Apache License, Version 2.0 cglib under Apache License, Version 2.0 + Checker Qual under The MIT License com.sun:tools under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 Commons Lang under The Apache Software License, Version 2.0 commons-collections under Apache License, Version 2.0 dom4j under BSD License Dough Lea's util.concurrent package under Public domain, Sun Microsoystems Ehcache Core under The Apache Software License, Version 2.0 - Ehcache Spring Annotations - Core under Apache 2 Ehcache Web Filters under The Apache Software License, Version 2.0 + error-prone annotations under Apache 2.0 fastinfoset under Apache License, Version 2.0 - Guava: Google Core Libraries for Java under The Apache Software License, Version 2.0 + FindBugs-jsr305 under The Apache Software License, Version 2.0 + Guava InternalFutureFailureAccess and InternalFutures under The Apache Software License, Version 2.0 + Guava ListenableFuture only under The Apache Software License, Version 2.0 + Guava: Google Core Libraries for Java under Apache License, Version 2.0 Hamcrest Core under New BSD License Hibernate Commons Annotations under GNU LESSER GENERAL PUBLIC LICENSE istack common utility code runtime under CDDL 1.1 or GPL2 w/ CPE + J2ObjC Annotations under The Apache Software License, Version 2.0 Jackson-annotations under The Apache Software License, Version 2.0 Jackson-core under The Apache Software License, Version 2.0 jackson-databind under The Apache Software License, Version 2.0 @@ -63,29 +67,25 @@ This project includes: Jasig CAS Client for Java - Core under Apache License Version 2.0 JASYPT: Java Simplified Encryption under The Apache Software License, Version 2.0 Java Portlet Specification V2.0 under Commons Development and Distribution License, Version 1.0 + Java Servlet API under CDDL + GPLv2 with classpath exception Java Transaction API under Common Development and Distribution License or GNU General Public License, Version 2 with the Classpath Exception JavaBeans Activation Framework API jar under CDDL/GPLv2+CE Javassist under MPL 1.1 or LGPL 2.1 or Apache License 2.0 javax.annotation API under CDDL + GPLv2 with classpath exception - JAXB Core under CDDL 1.1 or GPL2 w/ CPE + JAXB Core under CDDL+GPL License JAXB Reference Implementation under CDDL 1.1 or GPL2 w/ CPE jaxb-api under CDDL 1.1 or GPL2 w/ CPE JAXB2 Basics - Runtime under BSD-Style License JBoss Logging 3 under GNU Lesser General Public License, version 2.1 - JCL 1.2 implemented over SLF4J under Apache License, Version 2.0 JGroups under Apache License 2.0 JJWT :: API under Apache License, Version 2.0 - JJWT :: Extensions :: Jackson under Apache License, Version 2.0 - JJWT :: Impl under Apache License, Version 2.0 Joda-Time under Apache License, Version 2.0 JPA 2.0 API under Sun Binary Code License jsoup Java HTML Parser under The MIT License jsr173_api under Commons Development and Distribution License, Version 1.0 jstl under Commons Development and Distribution License, Version 1.0 - JUL to SLF4J bridge under MIT License JUnit under Eclipse Public License 1.0 LDAPTIVE CORE under Apache 2 or GNU Lesser General Public License - Log4j Implemented Over SLF4J under Apache Software Licenses Logback Classic Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License Logback Core Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License mockito-core under The MIT License @@ -97,15 +97,19 @@ This project includes: Person Directory Implementations under Apache License, Version 2.0 Portlet JDBC Utilities under Apache License Version 2.0 Portlet MVC Utilities under Apache License Version 2.0 + Portlet Servlet Adapter under Apache License, Version 2.0 + PortletMVC4Spring Framework under Apache License, Version 2.0 + PortletMVC4Spring Security under Apache License, Version 2.0 + Project Lombok under The MIT License Resource Server API under Apache License Version 2.0 Resource Server Content under Apache License Version 2.0 Resource Server Core under Apache License Version 2.0 Resource Server Utilities under Apache License Version 2.0 - servlet-api under Commons Development and Distribution License, Version 1.0 SLF4J API Module under MIT License Spring AOP under Apache License, Version 2.0 Spring Beans under Apache License, Version 2.0 Spring Binding under The Apache Software License, Version 2.0 + Spring Commons Logging Bridge under Apache License, Version 2.0 Spring Context under Apache License, Version 2.0 Spring Context Support under Apache License, Version 2.0 Spring Core under Apache License, Version 2.0 @@ -120,7 +124,6 @@ This project includes: Spring Web under Apache License, Version 2.0 Spring Web Flow under The Apache Software License, Version 2.0 Spring Web MVC under Apache License, Version 2.0 - Spring Web Portlet under Apache License, Version 2.0 spring-ldap-core under The Apache Software License, Version 2.0 spring-modules-cache under Apache License, Version 2.0 spring-security-core under The Apache Software License, Version 2.0 diff --git a/README.md b/README.md index c0a4e7eb..57a98a59 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ is rendered within the portlet window. Web Proxy Portlet is often used to incor are built and run in non-Java environments allowing a site flexibility for integrating content with many different technologies. -WebproxyPortlet v2 Gateway SSO is a feature that allows uPortal to sign on to any remote system even if the remote system +WebproxyPortlet v2 Gateway SSO (DEPRECATED) is a feature that allows uPortal to sign on to any remote system even if the remote system does not share any authentication information with uPortal. Gateway SSO will submit login information to the remote system and then redirect to that remote system. Other SSO solution assume that uPortal has authenticated to some system, such as CAS and will then trust CAS to say the user is authenticated. In this system, the authentication information is @@ -53,7 +53,7 @@ Web Proxy Portlet - Clipping to get subsections of the targeted URL - Uses AJAX to request and replace portlet content from whitelist of proxy URLs -Gateway SSO +Gateway SSO (DEPRECATED) - Log into remote services for users based on user attributes XSLT Portlet diff --git a/docs/gateway_config.md b/docs/gateway_config.md index c2390786..de124dfb 100644 --- a/docs/gateway_config.md +++ b/docs/gateway_config.md @@ -1,4 +1,5 @@ # Gateway SSO Configuration +*THIS PORTLET TYPE IS DEPRECATED* ![Example](Gateway SSO example.png) diff --git a/pom.xml b/pom.xml index 4d85720a..9abd219f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,10 @@ - org.jasig.parent - jasig-parent - 41 + org.jasig.portlet + uportal-portlet-parent + + 43-SNAPSHOT 4.0.0 @@ -51,18 +52,8 @@ 3.6.4 - 2.14.1 2.14.2 - 1.1.2 - 4.13.2 - 2.6 - 2.0 1.0.44 - 2.5 - 4.3.30.RELEASE - 1.3.5 - 2.0.6 - 4.9.0 1.1.3 5.15.1 @@ -74,43 +65,22 @@ commons-io 2.11.0 - - javax.portlet - portlet-api - ${portlet-api.version} - provided - - - javax.servlet - jstl - ${jstl.version} - - - javax.servlet - servlet-api - ${servlet-api.version} - provided - - - junit - junit - ${junit.version} - test - - - net.sf.ehcache - ehcache-core - 2.6.11 - org.apache.httpcomponents httpclient 4.5.13 - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} + + + + commons-logging + commons-logging + + + + commons-codec + commons-codec + + com.fasterxml.jackson.core @@ -131,14 +101,54 @@ org.jasig.portal uPortal-spring ${uportal-libs.version} - + + org.slf4j + log4j-over-slf4j + + - commons-collections - commons-collections + org.slf4j + jcl-over-slf4j + + + + org.springframework + spring-webmvc-portlet + + + + + org.jasig.portlet.utils + portlet-mvc-util + ${portlet.mvc.util.version} + + + org.hibernate + hibernate-core + + + + org.springframework + spring-webmvc-portlet + + + + javax.servlet + servlet-api + + + + org.slf4j + jcl-over-slf4j + + + + com.google.guava + guava - --> org.jasig.resourceserver @@ -150,88 +160,30 @@ org.jasig.resourceserver resource-server-utils ${resource-server.version} + runtime + + + + org.slf4j + jcl-over-slf4j + + + + com.google.guava + guava + + org.jsoup jsoup 1.15.3 - - org.mockito - mockito-core - ${mockito.version} - - - org.springframework - spring-aop - ${spring.version} - - - org.springframework - spring-test - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - - - org.springframework - spring-webmvc-portlet - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-context-support - ${spring.version} - taglibs standard ${jstl.version} - - - - commons-logging - commons-logging - 1.2 - provided - - - org.slf4j - slf4j-api - ${slf4jVersion} - - - org.slf4j - jul-to-slf4j - ${slf4jVersion} - - - org.slf4j - log4j-over-slf4j - ${slf4jVersion} - - - org.slf4j - jcl-over-slf4j - ${slf4jVersion} - - - ch.qos.logback - logback-classic - ${logbackVersion} - runtime - - - @@ -256,7 +208,6 @@ javax.portlet portlet-api - provided javax.servlet @@ -264,26 +215,16 @@ javax.servlet - servlet-api - provided + javax.servlet-api junit junit - test - - - net.sf.ehcache - ehcache-core org.apache.httpcomponents httpclient - - com.fasterxml.jackson.core - jackson-core - com.fasterxml.jackson.core jackson-databind @@ -318,8 +259,12 @@ spring-webmvc - org.springframework - spring-webmvc-portlet + com.liferay.portletmvc4spring + com.liferay.portletmvc4spring.framework + + + com.liferay.portletmvc4spring + com.liferay.portletmvc4spring.security taglibs @@ -339,24 +284,15 @@ org.jasig.portal uPortal-spring - org.jasig.portlet.utils portlet-mvc-util - ${portlet.mvc.util.version} - - - org.hibernate - hibernate-core - - - + org.jasig.resourceserver resource-server-utils - runtime @@ -364,110 +300,22 @@ org.slf4j slf4j-api - - org.slf4j - jul-to-slf4j - - - org.slf4j - log4j-over-slf4j - - - org.slf4j - jcl-over-slf4j - ch.qos.logback logback-classic - runtime + + + org.projectlombok + lombok + - com.mycila - license-maven-plugin - - ${basedir} -
${jasig-short-license-url}
- true - - .gitignore - src/test/resources/test.json - src/main/resources/test-content/sample.json - src/main/webapp/scripts/jquery-1.8.3.min.js - target/** - pom.xml.* - release.properties - LICENSE - NOTICE - NOTICE.template - bin/** - .idea/** - overlays/** - -
-
- - org.apache.maven.plugins - maven-release-plugin - 3.0.0-M7 - - - org.apache.maven.scm - maven-scm-provider-gitexe - 2.0.0-M3 - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - - - java.util.logging.config.file - src/test/resources/log4j.properties - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-versions - - enforce - - - - - 1.8 - - - - commons-collections:commons-collections:[3.2.1,4.0] - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - + org.apache.maven.plugins maven-war-plugin @@ -489,109 +337,6 @@ - - org.codehaus.mojo - surefire-report-maven-plugin - 2.0-beta-1 - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.5 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadocs - - jar - - - -
- - - - localdev - - - - org.apache.portals.pluto - maven-pluto-plugin - - - generate-resources - - assemble - - - - - - org.apache.maven.plugins - maven-war-plugin - - localdev - ${project.artifactId} - ${project.build.directory}/pluto-resources/web.xml - - - - maven-uportal-plugin - org.jasig.portal - - ${project.artifactId} - ${project.artifactId} - ${project.groupId} - ${project.version} - localdev - true - true - - - - - - - doclint-java8-disable - - [1.8,) - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - none - - - - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.2.0 - - google_checks.xml - - - -
diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/MinimizedStateHandlerInterceptor.java b/src/main/java/org/jasig/portlet/proxy/mvc/MinimizedStateHandlerInterceptor.java index fed157d4..e240a696 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/MinimizedStateHandlerInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/MinimizedStateHandlerInterceptor.java @@ -22,7 +22,7 @@ import javax.portlet.RenderResponse; import javax.portlet.WindowState; -import org.springframework.web.portlet.handler.HandlerInterceptorAdapter; +import com.liferay.portletmvc4spring.handler.HandlerInterceptorAdapter; /** *

MinimizedStateHandlerInterceptor class.

diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/ThemeNameViewSelectorImpl.java b/src/main/java/org/jasig/portlet/proxy/mvc/ThemeNameViewSelectorImpl.java index 240f52eb..8e748458 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/ThemeNameViewSelectorImpl.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/ThemeNameViewSelectorImpl.java @@ -18,10 +18,9 @@ */ package org.jasig.portlet.proxy.mvc; -import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import javax.portlet.PortletRequest; /** *

ThemeNameViewSelectorImpl class.

@@ -29,14 +28,13 @@ * @author bjagg * @version $Id: $Id */ +@Slf4j public class ThemeNameViewSelectorImpl implements IViewSelector { private static final String THEME_NAME_PROPERTY = "themeName"; private static final String MOBILE_THEMES_KEY = "mobileThemes"; private String[] mobileThemesDefault = new String[]{ "UniversalityMobile" }; - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - /** {@inheritDoc} */ public boolean isMobile(PortletRequest request) { @@ -46,7 +44,7 @@ public boolean isMobile(PortletRequest request) { // if no theme name can be found, just assume the request is for a // desktop client if (themeName == null) { - logger.debug("No theme name found, assuming desktop environment"); + log.debug("No theme name found, assuming desktop environment"); return false; } @@ -54,12 +52,12 @@ public boolean isMobile(PortletRequest request) { // mobile themes for (String theme : mobileThemes) { if (themeName.equals(theme)) { - logger.debug("Theme name {} matches configured list of mobile themes", themeName); + log.debug("Theme name {} matches configured list of mobile themes", themeName); return true; } } - logger.debug("No match found for theme name {}, assuming desktop environment", themeName); + log.debug("No match found for theme name {}, assuming desktop environment", themeName); return false; } diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/BaseGatewayPortletController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/BaseGatewayPortletController.java index 0cd5bd27..886f956a 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/BaseGatewayPortletController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/BaseGatewayPortletController.java @@ -29,6 +29,7 @@ * @author James Wennmacher, jwennmacher@unicon.net * @version $Id: $Id */ +@Deprecated // No known usage of this portlet type. Remove when we jump to Java 17. public class BaseGatewayPortletController { /** *

removeInaccessibleEntries.

diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayEntry.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayEntry.java index 0a0987b3..e8ffb0e4 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayEntry.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayEntry.java @@ -37,6 +37,7 @@ * @author Jen Bourey, jennifer.bourey@gmail.com * @version $Id: $Id */ +@Deprecated // No known usage of this portlet type. Remove when we jump to Java 17. public class GatewayEntry { private String name; diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletController.java index c869263d..0682cde2 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletController.java @@ -18,23 +18,22 @@ */ package org.jasig.portlet.proxy.mvc.portlet.gateway; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.jasig.portlet.proxy.mvc.IViewSelector; import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; import org.jasig.portlet.proxy.service.web.IAuthenticationFormModifier; import org.jasig.portlet.proxy.service.web.interceptor.IPreInterceptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.InvalidPropertyException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.portlet.ModelAndView; -import org.springframework.web.portlet.bind.annotation.RenderMapping; -import org.springframework.web.portlet.bind.annotation.ResourceMapping; +import org.springframework.web.servlet.ModelAndView; +import com.liferay.portletmvc4spring.bind.annotation.RenderMapping; +import com.liferay.portletmvc4spring.bind.annotation.ResourceMapping; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -56,11 +55,11 @@ */ @Controller @RequestMapping("VIEW") +@Slf4j +@Deprecated // No known usage of this portlet type. Remove when we jump to Java 17. public class GatewayPortletController extends BaseGatewayPortletController { private static final String HTTPS = "HTTPS"; - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - @Resource(name="gatewayEntries") private List gatewayEntries; @@ -88,7 +87,7 @@ private void validateGatewayEntries() { *

getView.

* * @param request a {@link javax.portlet.RenderRequest} object - * @return a {@link org.springframework.web.portlet.ModelAndView} object + * @return a {@link org.springframework.web.servlet.ModelAndView} object */ @RenderMapping public ModelAndView getView(RenderRequest request){ @@ -114,7 +113,7 @@ public ModelAndView getView(RenderRequest request){ mv.addObject("openInNewPage", openInNewPage); final String view = viewSelector.isMobile(request) ? mobileViewName : viewName; - mv.setView(view); + mv.setViewName(view); return mv; } @@ -199,7 +198,7 @@ private void prepareGatewayResponse(ResourceRequest portletRequest, ResourceResp if (entry.isRequireSecure() && StringUtils.isNotBlank(contentRequest.getProxiedLocation()) && contentRequest.getProxiedLocation().length() >= HTTPS.length()) { if (!HTTPS.equalsIgnoreCase(contentRequest.getProxiedLocation().substring(0, HTTPS.length()))) { - logger.error("Proxied location '" + contentRequest.getProxiedLocation() + "' for gateway entry " + log.error("Proxied location '" + contentRequest.getProxiedLocation() + "' for gateway entry " + entry.getName() + " is not secure - discarding entry!!!"); contentRequest.setParameters(new HashMap()); contentRequest.setProxiedLocation("/HTTPSUrlRequiredButNotSpecified"); // Force a failure that's clear diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletEditController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletEditController.java index 679996de..6d09b68b 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletEditController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPortletEditController.java @@ -39,16 +39,14 @@ import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; import org.jasig.portlet.proxy.service.web.interceptor.IPreInterceptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.portlet.ModelAndView; -import org.springframework.web.portlet.bind.annotation.ActionMapping; -import org.springframework.web.portlet.bind.annotation.RenderMapping; +import org.springframework.web.servlet.ModelAndView; +import com.liferay.portletmvc4spring.bind.annotation.ActionMapping; +import com.liferay.portletmvc4spring.bind.annotation.RenderMapping; /** *

GatewayPortletEditController class.

@@ -58,6 +56,7 @@ */ @Controller @RequestMapping("EDIT") +@Deprecated // No known usage of this portlet type. Remove when we jump to Java 17. public class GatewayPortletEditController extends BaseGatewayPortletController { /** Constant INCONSISTENT_FIELD_VALUES="edit.proxy.error.message.inconsistent.f"{trunked} */ public static final String INCONSISTENT_FIELD_VALUES = "edit.proxy.error.message.inconsistent.field.values"; @@ -67,7 +66,6 @@ public class GatewayPortletEditController extends BaseGatewayPortletController { public static final String ERROR_KEY = "error"; /** Constant GATEWAY_ENTRY="gatewayEntry" */ public static final String GATEWAY_ENTRY = "gatewayEntry"; - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); @Resource(name="gatewayEntries") private List gatewayEntries; @@ -113,7 +111,7 @@ public void setStringEncryptionService(IStringEncryptionService stringEncryption * * @param request a {@link javax.portlet.RenderRequest} object * @param entryName a {@link java.lang.String} object - * @return a {@link org.springframework.web.portlet.ModelAndView} object + * @return a {@link org.springframework.web.servlet.ModelAndView} object */ @RenderMapping public ModelAndView displayEditView(RenderRequest request, @RequestParam(required=false) String entryName) { @@ -136,7 +134,7 @@ public ModelAndView displayEditView(RenderRequest request, @RequestParam(require // Add descendingMap so username is listed before password for the form. mv.addObject(GATEWAY_ENTRY_PREFERENCES, preferencesForEntry.descendingMap()); - mv.setView( viewSelector.isMobile(request) ? mobileViewName : viewName); + mv.setViewName(viewSelector.isMobile(request) ? mobileViewName : viewName); return mv; } diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPreference.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPreference.java index 6f411ca7..72cdf749 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPreference.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/gateway/GatewayPreference.java @@ -24,6 +24,7 @@ * @author James Wennmacher, jwennmacher@unicon.net * @version $Id: $Id */ +@Deprecated // No known usage of this portlet type. Remove when we jump to Java 17. public class GatewayPreference { String system; String logicalFieldName; diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletController.java index 5d528695..7d7d3a23 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletController.java @@ -28,17 +28,16 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; +import lombok.extern.slf4j.Slf4j; import org.jasig.portlet.proxy.mvc.IViewSelector; import org.jasig.portlet.proxy.service.IContentRequest; import org.jasig.portlet.proxy.service.IContentResponse; import org.jasig.portlet.proxy.service.IContentService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.portlet.ModelAndView; +import org.springframework.web.servlet.ModelAndView; /** *

JsonPortletController class.

@@ -48,6 +47,7 @@ */ @Controller @RequestMapping("VIEW") +@Slf4j public class JsonPortletController { /** Constant CONTENT_LOCATION_KEY="location" */ @@ -58,9 +58,7 @@ public class JsonPortletController { protected static final String MAIN_VIEW_KEY = "mainView"; /** Constant MOBILE_VIEW_KEY="mobileView" */ protected static final String MOBILE_VIEW_KEY = "mobileView"; - - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - + private ApplicationContext applicationContext; /** @@ -89,7 +87,7 @@ public void setViewSelector(IViewSelector viewSelector) { *

showContent.

* * @param request a {@link javax.portlet.PortletRequest} object - * @return a {@link org.springframework.web.portlet.ModelAndView} object + * @return a {@link org.springframework.web.servlet.ModelAndView} object */ @RequestMapping public ModelAndView showContent(PortletRequest request) { diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/EditProxyController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/EditProxyController.java index fbafd44b..97864811 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/EditProxyController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/EditProxyController.java @@ -30,6 +30,7 @@ import javax.portlet.PortletPreferences; import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.jasig.portlet.proxy.search.ISearchService; import org.jasig.portlet.proxy.service.GenericContentRequestImpl; @@ -40,16 +41,14 @@ import org.jasig.portlet.proxy.service.web.interceptor.PortletPreferencesBasicAuthenticationPreInterceptor; import org.jasig.portlet.proxy.service.web.interceptor.ProxyCASAuthenticationPreInterceptor; import org.jasig.portlet.proxy.service.web.interceptor.UserInfoBasicAuthenticationPreInterceptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.portlet.bind.annotation.ActionMapping; -import org.springframework.web.portlet.bind.annotation.RenderMapping; +import com.liferay.portletmvc4spring.bind.annotation.ActionMapping; +import com.liferay.portletmvc4spring.bind.annotation.RenderMapping; /** * ProxyConfigController @@ -59,10 +58,9 @@ */ @Controller @RequestMapping("CONFIG") +@Slf4j public class EditProxyController { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - private Map pageCharacterEncodings; /** diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/ProxyPortletController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/ProxyPortletController.java index 57e8e4b6..976657a6 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/ProxyPortletController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/proxy/ProxyPortletController.java @@ -40,6 +40,7 @@ import javax.portlet.ResourceResponse; import javax.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apereo.portal.search.SearchConstants; import org.apereo.portal.search.SearchResults; @@ -52,19 +53,16 @@ import org.jasig.portlet.proxy.service.web.HttpContentResponseImpl; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.portlet.bind.annotation.ActionMapping; -import org.springframework.web.portlet.bind.annotation.EventMapping; -import org.springframework.web.portlet.bind.annotation.RenderMapping; -import org.springframework.web.portlet.bind.annotation.ResourceMapping; +import com.liferay.portletmvc4spring.bind.annotation.ActionMapping; +import com.liferay.portletmvc4spring.bind.annotation.EventMapping; +import com.liferay.portletmvc4spring.bind.annotation.RenderMapping; +import com.liferay.portletmvc4spring.bind.annotation.ResourceMapping; /** * ProxyPortletController is the main view controller for web proxy portlets. @@ -74,6 +72,7 @@ */ @Controller @RequestMapping("VIEW") +@Slf4j public class ProxyPortletController { /** Constant PREF_CHARACTER_ENCODING="sourcePageCharacterEncoding" */ @@ -84,7 +83,6 @@ public class ProxyPortletController { protected static final String CONTENT_SERVICE_KEY = "contentService"; /** Constant FILTER_LIST_KEY="filters" */ protected static final String FILTER_LIST_KEY = "filters"; - protected final Logger log = LoggerFactory.getLogger(this.getClass()); private static final String PROXY_RESPONSE_KEY = "proxyResponse"; @Autowired private ApplicationContext applicationContext; diff --git a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/xslt/XsltPortletController.java b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/xslt/XsltPortletController.java index acf0c596..d384dc35 100644 --- a/src/main/java/org/jasig/portlet/proxy/mvc/portlet/xslt/XsltPortletController.java +++ b/src/main/java/org/jasig/portlet/proxy/mvc/portlet/xslt/XsltPortletController.java @@ -21,17 +21,16 @@ import javax.portlet.PortletPreferences; import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.jasig.portlet.proxy.mvc.IViewSelector; import org.jasig.portlet.proxy.service.IContentRequest; import org.jasig.portlet.proxy.service.IContentResponse; import org.jasig.portlet.proxy.service.IContentService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.portlet.ModelAndView; +import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.xslt.XsltView; /** @@ -42,6 +41,7 @@ */ @Controller @RequestMapping("VIEW") +@Slf4j public class XsltPortletController { /** Constant CONTENT_LOCATION_KEY="location" */ @@ -53,8 +53,6 @@ public class XsltPortletController { /** Constant MOBILE_XSLT_KEY="mobileXslt" */ protected static final String MOBILE_XSLT_KEY = "mobileXslt"; - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - private ApplicationContext applicationContext; /** @@ -83,7 +81,7 @@ public void setViewSelector(IViewSelector viewSelector) { *

showContent.

* * @param request a {@link javax.portlet.PortletRequest} object - * @return a {@link org.springframework.web.portlet.ModelAndView} object + * @return a {@link org.springframework.web.servlet.ModelAndView} object */ @RequestMapping public ModelAndView showContent(PortletRequest request) { diff --git a/src/main/java/org/jasig/portlet/proxy/search/AnchorSearchStrategy.java b/src/main/java/org/jasig/portlet/proxy/search/AnchorSearchStrategy.java index 8af5d631..c2c46143 100644 --- a/src/main/java/org/jasig/portlet/proxy/search/AnchorSearchStrategy.java +++ b/src/main/java/org/jasig/portlet/proxy/search/AnchorSearchStrategy.java @@ -27,6 +27,7 @@ import javax.portlet.PortletMode; import javax.portlet.WindowState; +import lombok.extern.slf4j.Slf4j; import org.apereo.portal.search.PortletUrl; import org.apereo.portal.search.PortletUrlParameter; import org.apereo.portal.search.PortletUrlType; @@ -36,8 +37,6 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; /** @@ -46,9 +45,8 @@ * @author bjagg * @version $Id: $Id */ +@Slf4j public class AnchorSearchStrategy implements ISearchStrategy { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - private ISearchService contentSearchProvider; /** *

Setter for the field contentSearchProvider.

diff --git a/src/main/java/org/jasig/portlet/proxy/search/DefaultSearchService.java b/src/main/java/org/jasig/portlet/proxy/search/DefaultSearchService.java index b797df14..3e4149a4 100644 --- a/src/main/java/org/jasig/portlet/proxy/search/DefaultSearchService.java +++ b/src/main/java/org/jasig/portlet/proxy/search/DefaultSearchService.java @@ -29,8 +29,6 @@ import org.apereo.portal.search.SearchResult; import org.apereo.portal.search.SearchResults; import org.jsoup.nodes.Document; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** *

DefaultSearchService class.

@@ -43,8 +41,6 @@ public class DefaultSearchService implements ISearchService { /** Constant SEARCH_STRATEGIES_PREFERENCE="searchStrategies" */ public static final String SEARCH_STRATEGIES_PREFERENCE = "searchStrategies"; - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - private Map strategies = new HashMap(); /** {@inheritDoc} */ @Override diff --git a/src/main/java/org/jasig/portlet/proxy/search/GsaSearchStrategy.java b/src/main/java/org/jasig/portlet/proxy/search/GsaSearchStrategy.java index c3a45081..8ff41c82 100644 --- a/src/main/java/org/jasig/portlet/proxy/search/GsaSearchStrategy.java +++ b/src/main/java/org/jasig/portlet/proxy/search/GsaSearchStrategy.java @@ -37,6 +37,7 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; +import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpResponse; import org.apache.http.impl.client.DecompressingHttpClient; import org.apache.http.impl.client.DefaultHttpClient; @@ -48,8 +49,6 @@ import org.apereo.portal.search.SearchRequest; import org.apereo.portal.search.SearchResult; import org.jasig.portlet.proxy.search.util.SearchUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; import org.w3c.dom.Document; import org.xml.sax.SAXException; @@ -60,8 +59,8 @@ * @author bjagg * @version $Id: $Id */ +@Slf4j public class GsaSearchStrategy implements ISearchStrategy { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); private ISearchService contentSearchProvider; /** diff --git a/src/main/java/org/jasig/portlet/proxy/search/util/SearchUtil.java b/src/main/java/org/jasig/portlet/proxy/search/util/SearchUtil.java index 3fd2c9fa..1900aa96 100644 --- a/src/main/java/org/jasig/portlet/proxy/search/util/SearchUtil.java +++ b/src/main/java/org/jasig/portlet/proxy/search/util/SearchUtil.java @@ -25,10 +25,9 @@ import javax.portlet.PortletRequest; import javax.portlet.PortletSession; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.portlet.util.PortletUtils; +import com.liferay.portletmvc4spring.util.PortletUtils; /** *

SearchUtil class.

@@ -36,8 +35,8 @@ * @author bjagg * @version $Id: $Id */ +@Slf4j public class SearchUtil { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); /** *

updateUrls.

diff --git a/src/main/java/org/jasig/portlet/proxy/security/JasyptPBEStringEncryptionServiceImpl.java b/src/main/java/org/jasig/portlet/proxy/security/JasyptPBEStringEncryptionServiceImpl.java index 385ae6fd..deeb5357 100644 --- a/src/main/java/org/jasig/portlet/proxy/security/JasyptPBEStringEncryptionServiceImpl.java +++ b/src/main/java/org/jasig/portlet/proxy/security/JasyptPBEStringEncryptionServiceImpl.java @@ -18,11 +18,10 @@ */ package org.jasig.portlet.proxy.security; +import lombok.extern.slf4j.Slf4j; import org.jasypt.encryption.pbe.PBEStringEncryptor; import org.jasypt.exceptions.EncryptionInitializationException; import org.jasypt.exceptions.EncryptionOperationNotPossibleException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; import org.springframework.util.Assert; @@ -36,8 +35,8 @@ * @author Jen Bourey * @version $Id: $Id */ +@Slf4j public class JasyptPBEStringEncryptionServiceImpl implements IStringEncryptionService { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); private PBEStringEncryptor encryptor = null; @@ -56,7 +55,7 @@ public String encrypt(final String plaintext) { try { return this.encryptor.encrypt(plaintext); } catch (EncryptionInitializationException e) { - logger.warn(e.getMessage(), e); + log.warn(e.getMessage(), e); throw new StringEncryptionException("Encryption error. Verify an encryption password" + " is configured in configuration.properties", e); } @@ -67,13 +66,13 @@ private String decrypt(final String cryptotext, boolean logError) { return this.encryptor.decrypt(cryptotext); } catch (EncryptionInitializationException e) { if (logError) { - logger.warn("Decryption failed. Error message: {}", e.getMessage()); + log.warn("Decryption failed. Error message: {}", e.getMessage()); } throw new StringEncryptionException("Decryption error. Was encryption password" + " changed in the configuration.properties?", e); } catch (EncryptionOperationNotPossibleException e) { if (logError) { - logger.warn("Decryption failed. This suggests the salt key in " + log.warn("Decryption failed. This suggests the salt key in " + "configuration.properties has been changed."); } throw new StringEncryptionException("Decryption error. Was encryption password" @@ -102,7 +101,7 @@ public void afterPropertiesSet() throws Exception { Assert.isTrue(dec.equals(this.getClass().getName()), "String decryption failed to decode the encrypted text " + enc); if (usingDefaultEncryptionKey()) { - logger.error("Encryption key at default value. Change it in configuration.properties for improved security!"); + log.error("Encryption key at default value. Change it in configuration.properties for improved security!"); } } diff --git a/src/main/java/org/jasig/portlet/proxy/service/ClasspathResourceContentService.java b/src/main/java/org/jasig/portlet/proxy/service/ClasspathResourceContentService.java index a90a6ce2..d081c278 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/ClasspathResourceContentService.java +++ b/src/main/java/org/jasig/portlet/proxy/service/ClasspathResourceContentService.java @@ -22,8 +22,7 @@ import javax.portlet.PortletRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import lombok.extern.slf4j.Slf4j; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.stereotype.Service; @@ -36,9 +35,8 @@ * @version $Id: $Id */ @Service("classpathContentService") +@Slf4j public class ClasspathResourceContentService implements IContentService { - - protected final Logger log = LoggerFactory.getLogger(this.getClass()); /** {@inheritDoc} */ @Override diff --git a/src/main/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilter.java b/src/main/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilter.java index 05d796f6..d748b95a 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilter.java +++ b/src/main/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilter.java @@ -33,6 +33,7 @@ import javax.portlet.RenderResponse; import javax.portlet.ResourceURL; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.apache.http.client.utils.URIBuilder; import org.jasig.portlet.proxy.service.IContentResponse; @@ -40,10 +41,8 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import org.springframework.web.portlet.util.PortletUtils; +import com.liferay.portletmvc4spring.util.PortletUtils; /** *

URLRewritingFilter class.

@@ -52,6 +51,7 @@ * @version $Id: $Id */ @Service("urlRewritingFilter") +@Slf4j public class URLRewritingFilter implements IDocumentFilter { /** Constant REWRITTEN_URLS_KEY="rewrittenUrls" */ @@ -59,8 +59,6 @@ public class URLRewritingFilter implements IDocumentFilter { /** Constant WHITELIST_REGEXES_KEY="whitelistRegexes" */ public final static String WHITELIST_REGEXES_KEY = "whitelistRegexes"; - protected final Logger LOG = LoggerFactory.getLogger(this.getClass()); - private Map> actionElements; /** @@ -156,9 +154,9 @@ protected void updateUrls(final Document document, final IContentResponse proxyR try { baseUrl = getBaseServerUrl(proxyResponse.getProxiedLocation()); relativeUrl = getRelativePathUrl(proxyResponse.getProxiedLocation()); - LOG.trace("Computed base url {} and relative url {} for proxied url {}", baseUrl, relativeUrl, proxyResponse.getProxiedLocation()); + log.trace("Computed base url {} and relative url {} for proxied url {}", baseUrl, relativeUrl, proxyResponse.getProxiedLocation()); } catch (URISyntaxException e) { - LOG.error(e.getMessage(), e); + log.error(e.getMessage(), e); } for (final Map.Entry> elementEntry : elementSet.entrySet()) { @@ -170,7 +168,7 @@ protected void updateUrls(final Document document, final IContentResponse proxyR for (Element element : elements) { String attributeUrl = element.attr(attributeName); - LOG.trace("Considering element {} with URL attribute {} of value {}", element, attributeName, attributeUrl); + log.trace("Considering element {} with URL attribute {} of value {}", element, attributeName, attributeUrl); // Ignore blank if (StringUtils.isBlank(attributeUrl)) { diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/ExampleCustomFormModifier.java b/src/main/java/org/jasig/portlet/proxy/service/web/ExampleCustomFormModifier.java index beefd633..88685f73 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/ExampleCustomFormModifier.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/ExampleCustomFormModifier.java @@ -18,8 +18,7 @@ */ package org.jasig.portlet.proxy.service.web; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import lombok.extern.slf4j.Slf4j; import javax.portlet.PortletPreferences; import java.io.IOException; @@ -32,10 +31,9 @@ * @author bjagg * @version $Id: $Id */ +@Slf4j public class ExampleCustomFormModifier implements IAuthenticationFormModifier { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - /** * {@inheritDoc} * @@ -58,9 +56,9 @@ public void modifyHttpContentRequest(HttpContentRequestImpl contentRequest, Port tokenID = tokenID.replaceAll("=",""); tokenID = tokenID.replaceAll(",",""); contentRequest.addParameter("tokenID", tokenID); // For use by javascript - logger.debug("urlSource: " + urlSource); + log.debug("urlSource: " + urlSource); String postUrl = urlSource+tokenID+"&SS=LGRQ&URL=https%3A%2F%2Fwa-usd.prod.sdbor.edu%2FWebAdvisor%2Fwebadvisor%3F%26TYPE%3DM%26PID%3DCORE-WBMAIN%26TOKENIDX%3D"+tokenID; - logger.debug("postURL: " + postUrl); + log.debug("postURL: " + postUrl); contentRequest.setProxiedLocation(postUrl); } diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentRequestImpl.java b/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentRequestImpl.java index eaeaaf89..abea0ccb 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentRequestImpl.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentRequestImpl.java @@ -35,8 +35,6 @@ import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.proxy.document.URLRewritingFilter; import org.jasig.portlet.spring.IExpressionProcessor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** *

HttpContentRequestImpl class.

@@ -46,8 +44,6 @@ */ public class HttpContentRequestImpl extends GenericContentRequestImpl { - private static final Logger log = LoggerFactory.getLogger(HttpContentRequestImpl.class); - private Map parameters = new HashMap(); private Map headers = new HashMap(); private String method; diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImpl.java b/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImpl.java index 2ee1d326..19f7f3cc 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImpl.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImpl.java @@ -30,6 +30,7 @@ import javax.portlet.PortletPreferences; import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -47,8 +48,6 @@ import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.web.interceptor.IPreInterceptor; import org.jasig.portlet.spring.IExpressionProcessor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; import org.springframework.context.ApplicationContext; @@ -61,10 +60,9 @@ * @version $Id: $Id */ @Service("httpContentService") +@Slf4j public class HttpContentServiceImpl implements IContentService { - private final Logger log = LoggerFactory.getLogger(this.getClass()); - /** Constant PROXY_PORTLET_PARAM_PREFIX="proxy." */ public final static String PROXY_PORTLET_PARAM_PREFIX = "proxy."; /** Constant URL_PARAM="PROXY_PORTLET_PARAM_PREFIX.concat(url)" */ diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImpl.java b/src/main/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImpl.java index 0743c9b0..4d559ccb 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImpl.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImpl.java @@ -25,10 +25,8 @@ import org.apache.http.client.HttpClient; import org.apache.http.client.config.RequestConfig; import org.apache.http.impl.client.HttpClientBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import org.springframework.web.portlet.util.PortletUtils; +import com.liferay.portletmvc4spring.util.PortletUtils; /** * MultiRequestHttpClientServiceImpl associates a single HTTP client with each @@ -40,7 +38,6 @@ */ @Service public class MultiRequestHttpClientServiceImpl implements IHttpClientService { - private static final Logger LOG = LoggerFactory.getLogger(MultiRequestHttpClientServiceImpl.class); /** Constant HTTP_CLIENT_CONNECTION_TIMEOUT="httpClientConnectionTimeout" */ public static final String HTTP_CLIENT_CONNECTION_TIMEOUT = "httpClientConnectionTimeout"; /** Constant HTTP_CLIENT_CONNECTION_REQUEST_TIMEOUT="httpClientConnectionRequestTimeout" */ diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/AuthenticationPreInterceptor.java b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/AuthenticationPreInterceptor.java index c6d86a1a..1bdf5418 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/AuthenticationPreInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/AuthenticationPreInterceptor.java @@ -22,10 +22,9 @@ import javax.portlet.PortletRequest; import javax.portlet.PortletSession; +import lombok.extern.slf4j.Slf4j; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.portlet.util.PortletUtils; +import com.liferay.portletmvc4spring.util.PortletUtils; /** * AuthenticationPreInterceptor provides a base class for implementing authentication @@ -36,10 +35,9 @@ * @author Jen Bourey * @version $Id: $Id */ +@Slf4j public abstract class AuthenticationPreInterceptor implements IPreInterceptor { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - /** Constant AUTHENTICATION_TIMEOUT_KEY="authenticationTimeout" */ public static final String AUTHENTICATION_TIMEOUT_KEY = "authenticationTimeout"; /** Constant AUTHENTICATION_TIMESTAMP_KEY="authenticationTimestamp" */ diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptor.java b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptor.java index 15670283..4d86eb00 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptor.java @@ -24,9 +24,8 @@ import javax.portlet.PortletRequest; import javax.portlet.PortletPreferences; +import lombok.extern.slf4j.Slf4j; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; /** @@ -37,10 +36,9 @@ * @version $Id: $Id */ @Service("headerPassingPreInterceptor") +@Slf4j public class HeaderPassingPreInterceptor implements IPreInterceptor { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - /** Constant HEADER_PREFERENCE_NAMES="headerNames" */ public static final String HEADER_PREFERENCE_NAMES = "headerNames"; /** Constant HEADER_PREFERENCE_VALUES="headerValues" */ @@ -63,7 +61,7 @@ public void intercept(HttpContentRequestImpl proxyRequest, PortletRequest portle } proxyRequest.setHeaders(headerMap); }else{ - logger.warn("Invalid data in preferences. Header name array length does not equal header value array length"); + log.warn("Invalid data in preferences. Header name array length does not equal header value array length"); } } diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/ProxyCASAuthenticationPreInterceptor.java b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/ProxyCASAuthenticationPreInterceptor.java index 6e9a1a42..b0bc137d 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/ProxyCASAuthenticationPreInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/ProxyCASAuthenticationPreInterceptor.java @@ -23,6 +23,7 @@ import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.apache.http.client.utils.URIBuilder; import org.jasig.cas.client.validation.Assertion; import org.jasig.cas.client.validation.TicketValidationException; @@ -43,6 +44,7 @@ * @version $Id: $Id */ @Service(ProxyCASAuthenticationPreInterceptor.BEAN_ID) +@Slf4j public class ProxyCASAuthenticationPreInterceptor extends AuthenticationPreInterceptor { /** Constant BEAN_ID="proxyCASAuthenticationPreInterceptor" */ diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptor.java b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptor.java index d6dca665..b95deb5f 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptor.java @@ -25,10 +25,9 @@ import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; /** @@ -42,10 +41,9 @@ * @version $Id: $Id */ @Service("userInfoUrlParameterizingPreInterceptor") +@Slf4j public class UserInfoUrlParameterizingPreInterceptor implements IPreInterceptor { - - protected final Logger log = LoggerFactory.getLogger(this.getClass()); - + /** {@inheritDoc} */ @Override public void intercept(HttpContentRequestImpl proxyRequest, diff --git a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserPreferencesPreInterceptor.java b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserPreferencesPreInterceptor.java index 492e72ea..f976f2d8 100644 --- a/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserPreferencesPreInterceptor.java +++ b/src/main/java/org/jasig/portlet/proxy/service/web/interceptor/UserPreferencesPreInterceptor.java @@ -23,12 +23,11 @@ import javax.portlet.PortletPreferences; import javax.portlet.PortletRequest; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.jasig.portlet.proxy.security.IStringEncryptionService; import org.jasig.portlet.proxy.service.IFormField; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -40,8 +39,8 @@ * @version $Id: $Id */ @Service("UserPreferencesPreInterceptor") +@Slf4j public class UserPreferencesPreInterceptor implements IPreInterceptor { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); private String preferencesRegex; @@ -76,7 +75,7 @@ public void intercept(HttpContentRequestImpl proxyRequest, if (parameterValue.matches(preferencesRegex)) { String preferredValue = prefs.getValue(parameterValue, parameterValue); if (parameter.getSecured() && StringUtils.isNotBlank(preferredValue) && stringEncryptionService != null) { - logger.debug("decrypting preferredValue '" + preferredValue + "' for parameterKey: '" + parameterKey); + log.debug("decrypting preferredValue '" + preferredValue + "' for parameterKey: '" + parameterKey); preferredValue = stringEncryptionService.decrypt(preferredValue); } parameterValues[i] = preferredValue; diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties deleted file mode 100644 index 2e9212ef..00000000 --- a/src/main/resources/log4j.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to Apereo under one or more contributor license -# agreements. See the NOTICE file distributed with this work -# for additional information regarding copyright ownership. -# Apereo licenses this file to you under the Apache License, -# Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a -# copy of the License at the following location: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - diff --git a/src/main/webapp/WEB-INF/context/applicationContext.xml b/src/main/webapp/WEB-INF/context/applicationContext.xml index c35fe889..a380b86a 100644 --- a/src/main/webapp/WEB-INF/context/applicationContext.xml +++ b/src/main/webapp/WEB-INF/context/applicationContext.xml @@ -136,8 +136,6 @@ - @@ -148,7 +146,7 @@ - + + - + diff --git a/src/main/webapp/WEB-INF/context/portlet/json-portlet.xml b/src/main/webapp/WEB-INF/context/portlet/json-portlet.xml index 4a518887..27a15588 100644 --- a/src/main/webapp/WEB-INF/context/portlet/json-portlet.xml +++ b/src/main/webapp/WEB-INF/context/portlet/json-portlet.xml @@ -29,7 +29,7 @@ - + diff --git a/src/main/webapp/WEB-INF/context/portlet/webproxy-portlet.xml b/src/main/webapp/WEB-INF/context/portlet/webproxy-portlet.xml index 38f9ce0c..ce7bcbf6 100644 --- a/src/main/webapp/WEB-INF/context/portlet/webproxy-portlet.xml +++ b/src/main/webapp/WEB-INF/context/portlet/webproxy-portlet.xml @@ -29,7 +29,7 @@ - + diff --git a/src/main/webapp/WEB-INF/context/portlet/xslt-portlet.xml b/src/main/webapp/WEB-INF/context/portlet/xslt-portlet.xml index e20e7b3a..b3760ec6 100644 --- a/src/main/webapp/WEB-INF/context/portlet/xslt-portlet.xml +++ b/src/main/webapp/WEB-INF/context/portlet/xslt-portlet.xml @@ -29,7 +29,7 @@ - + diff --git a/src/main/webapp/WEB-INF/context/views.xml b/src/main/webapp/WEB-INF/context/views.xml deleted file mode 100644 index aea12700..00000000 --- a/src/main/webapp/WEB-INF/context/views.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/portlet.xml b/src/main/webapp/WEB-INF/portlet.xml index e6264958..2995759e 100644 --- a/src/main/webapp/WEB-INF/portlet.xml +++ b/src/main/webapp/WEB-INF/portlet.xml @@ -27,7 +27,7 @@ WebProxyPortlet - org.springframework.web.portlet.DispatcherPortlet + com.liferay.portletmvc4spring.DispatcherPortlet contextConfigLocation /WEB-INF/context/portlet/webproxy-portlet.xml @@ -85,7 +85,7 @@ XsltPortlet - org.springframework.web.portlet.DispatcherPortlet + com.liferay.portletmvc4spring.DispatcherPortlet contextConfigLocation /WEB-INF/context/portlet/xslt-portlet.xml @@ -116,7 +116,7 @@ JsonPortlet - org.springframework.web.portlet.DispatcherPortlet + com.liferay.portletmvc4spring.DispatcherPortlet contextConfigLocation GatewayPortlet - org.springframework.web.portlet.DispatcherPortlet + com.liferay.portletmvc4spring.DispatcherPortlet contextConfigLocation /WEB-INF/context/portlet/gateway-sso-portlet.xml diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 082cfb66..e69ab2f8 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -30,11 +30,6 @@ org.jasig.portlet.proxy.portlet.root - - log4jConfigLocation - /WEB-INF/classes/log4j.properties - - contextConfigLocation /WEB-INF/context/applicationContext.xml,classpath:/properties/contextOverrides/*.xml @@ -44,12 +39,6 @@ org.springframework.web.util.WebAppRootListener - - - org.springframework.web.util.Log4jConfigListener - - - org.springframework.web.context.ContextLoaderListener @@ -74,7 +63,7 @@ ViewRendererServlet - org.springframework.web.servlet.ViewRendererServlet + com.liferay.portletmvc4spring.ViewRendererServlet 1 diff --git a/src/test/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletControllerTest.java b/src/test/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletControllerTest.java index 1cf0597e..fa7828a0 100644 --- a/src/test/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletControllerTest.java +++ b/src/test/java/org/jasig/portlet/proxy/mvc/portlet/json/JsonPortletControllerTest.java @@ -29,19 +29,20 @@ import javax.portlet.PortletResponse; import org.jasig.portlet.proxy.mvc.IViewSelector; -import org.jasig.portlet.proxy.mvc.portlet.json.JsonPortletController; import org.jasig.portlet.proxy.service.ClasspathResourceContentService; import org.jasig.portlet.proxy.service.IContentService; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.springframework.context.ApplicationContext; -import org.springframework.web.portlet.ModelAndView; +import org.springframework.web.servlet.ModelAndView; /** * @author Jen Bourey, jennifer.bourey@gmail.com */ +@RunWith(MockitoJUnitRunner.class) public class JsonPortletControllerTest { JsonPortletController controller; @@ -55,8 +56,7 @@ public class JsonPortletControllerTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - + controller = new JsonPortletController(); controller.setViewSelector(viewSelector); controller.setApplicationContext(applicationContext); @@ -97,7 +97,6 @@ public void testMobileView() { @Test public void testNoMobileView() { - when(viewSelector.isMobile(request)).thenReturn(true); when(preferences.getValue(JsonPortletController.MOBILE_VIEW_KEY, null)).thenReturn(null); final ModelAndView mv = controller.showContent(request); assertEquals(mv.getViewName(), "main"); diff --git a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/ContentClippingFilterTest.java b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/ContentClippingFilterTest.java index 44faee04..9dce5d7b 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/ContentClippingFilterTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/ContentClippingFilterTest.java @@ -26,17 +26,18 @@ import javax.portlet.RenderResponse; import org.jasig.portlet.proxy.service.GenericContentResponseImpl; -import org.jasig.portlet.proxy.service.proxy.document.ContentClippingFilter; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; /** * @author Jen Bourey, jennifer.bourey@gmail.com */ +@RunWith(MockitoJUnitRunner.class) public class ContentClippingFilterTest { ContentClippingFilter filter; @@ -48,8 +49,6 @@ public class ContentClippingFilterTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - filter = new ContentClippingFilter(); when(request.getPreferences()).thenReturn(preferences); diff --git a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/HeaderFooterFilterTest.java b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/HeaderFooterFilterTest.java index b710a3d8..1b39411b 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/HeaderFooterFilterTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/HeaderFooterFilterTest.java @@ -29,9 +29,11 @@ import org.jsoup.nodes.Document; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class HeaderFooterFilterTest { private HeaderFooterFilter filter; @@ -44,7 +46,6 @@ public class HeaderFooterFilterTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); when(portletRequest.getPreferences()).thenReturn(preferences); filter = new HeaderFooterFilter(); diff --git a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilterTest.java b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilterTest.java index d8270826..6095e18a 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilterTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/proxy/document/URLRewritingFilterTest.java @@ -43,12 +43,14 @@ import org.jsoup.nodes.Document; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; /** * @author Jen Bourey, jennifer.bourey@gmail.com */ +@RunWith(MockitoJUnitRunner.class) public class URLRewritingFilterTest { URLRewritingFilter filter; @@ -63,8 +65,6 @@ public class URLRewritingFilterTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - when(request.getPortletSession()).thenReturn(session); when(session.getAttribute(URLRewritingFilter.REWRITTEN_URLS_KEY)).thenReturn(rewrittenUrls); when(request.getPreferences()).thenReturn(preferences); diff --git a/src/test/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImplTest.java b/src/test/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImplTest.java index 7b91dbf1..11bbcf49 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImplTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/web/HttpContentServiceImplTest.java @@ -33,10 +33,13 @@ import org.junit.Before; import org.junit.Test; import static org.mockito.ArgumentMatchers.any; + +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import org.mockito.Spy; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class HttpContentServiceImplTest { @Spy HttpContentServiceImpl service; @@ -47,7 +50,6 @@ public class HttpContentServiceImplTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); when(request.getParameterMap()).thenReturn(params); when(request.getPreferences()).thenReturn(preferences); diff --git a/src/test/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImplTest.java b/src/test/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImplTest.java index fa488d2e..cdec1eb3 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImplTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImplTest.java @@ -30,9 +30,11 @@ import org.apache.http.client.HttpClient; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class MultiRequestHttpClientServiceImplTest { @Mock PortletRequest request; @@ -43,8 +45,6 @@ public class MultiRequestHttpClientServiceImplTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - service = new MultiRequestHttpClientServiceImpl(); when(request.getPreferences()).thenReturn(preferences); diff --git a/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptorTest.java b/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptorTest.java index 55591997..94defc89 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptorTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/HeaderPassingPreInterceptorTest.java @@ -24,8 +24,8 @@ import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import static org.mockito.Mockito.when; import java.util.HashMap; @@ -35,7 +35,9 @@ import javax.portlet.PortletPreferences; import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class HeaderPassingPreInterceptorTest { HeaderPassingPreInterceptor preprocessor; @@ -48,8 +50,6 @@ public class HeaderPassingPreInterceptorTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - preprocessor = new HeaderPassingPreInterceptor(); headerNames = new String[]{"uid", "ApplicationSpecificCN", "displayName"}; diff --git a/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptorTest.java b/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptorTest.java index 0d354219..bbff99ba 100644 --- a/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptorTest.java +++ b/src/test/java/org/jasig/portlet/proxy/service/web/interceptor/UserInfoUrlParameterizingPreInterceptorTest.java @@ -31,9 +31,11 @@ import org.jasig.portlet.proxy.service.web.HttpContentRequestImpl; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class UserInfoUrlParameterizingPreInterceptorTest { UserInfoUrlParameterizingPreInterceptor preprocessor; @@ -44,8 +46,6 @@ public class UserInfoUrlParameterizingPreInterceptorTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); - preprocessor = new UserInfoUrlParameterizingPreInterceptor(); parameters = new HashMap();