@Test public void testNull() { MockHttpServletRequest httpServletRequest = new MockHttpServletRequest(); PortletWindow plutoPortletWindow = mock(PortletWindow.class); RequestAttributeServiceImpl service = new RequestAttributeServiceImpl(); Assert.assertNull(service.getAttribute(httpServletRequest, plutoPortletWindow, null)); Assert.assertNull( service.getAttribute(httpServletRequest, plutoPortletWindow, "someotherattribute")); }
@Override public Object getAttribute( HttpServletRequest httpServletRequest, PortletWindow plutoPortletWindow, String attributeName) { if (IPortletRenderer.MULTIVALUED_USERINFO_MAP_ATTRIBUTE.equals(attributeName)) { final String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow( httpServletRequest, plutoPortletWindow); final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow); return getMultiValuedUserInfoMap(remoteUser, expectedUserAttributes); } return null; }
RequestAttributeServiceImpl implements RequestAttributeService { @Override public Object getAttribute( HttpServletRequest httpServletRequest, PortletWindow plutoPortletWindow, String attributeName) { if (IPortletRenderer.MULTIVALUED_USERINFO_MAP_ATTRIBUTE.equals(attributeName)) { final String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow( httpServletRequest, plutoPortletWindow); final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow); return getMultiValuedUserInfoMap(remoteUser, expectedUserAttributes); } return null; } }
RequestAttributeServiceImpl implements RequestAttributeService { @Override public Object getAttribute( HttpServletRequest httpServletRequest, PortletWindow plutoPortletWindow, String attributeName) { if (IPortletRenderer.MULTIVALUED_USERINFO_MAP_ATTRIBUTE.equals(attributeName)) { final String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow( httpServletRequest, plutoPortletWindow); final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow); return getMultiValuedUserInfoMap(remoteUser, expectedUserAttributes); } return null; }  }
RequestAttributeServiceImpl implements RequestAttributeService { @Override public Object getAttribute( HttpServletRequest httpServletRequest, PortletWindow plutoPortletWindow, String attributeName) { if (IPortletRenderer.MULTIVALUED_USERINFO_MAP_ATTRIBUTE.equals(attributeName)) { final String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow( httpServletRequest, plutoPortletWindow); final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow); return getMultiValuedUserInfoMap(remoteUser, expectedUserAttributes); } return null; }  @Autowired void setPersonAttributeDao(IPersonAttributeDao personAttributeDao); @Autowired void setPortletWindowRegistry(IPortletWindowRegistry portletWindowRegistry); @Autowired void setPortletDefinitionRegistry(IPortletDefinitionRegistry portletDefinitionRegistry); @Override Object getAttribute(
            HttpServletRequest httpServletRequest,
            PortletWindow plutoPortletWindow,
            String attributeName); }
RequestAttributeServiceImpl implements RequestAttributeService { @Override public Object getAttribute( HttpServletRequest httpServletRequest, PortletWindow plutoPortletWindow, String attributeName) { if (IPortletRenderer.MULTIVALUED_USERINFO_MAP_ATTRIBUTE.equals(attributeName)) { final String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow( httpServletRequest, plutoPortletWindow); final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow); return getMultiValuedUserInfoMap(remoteUser, expectedUserAttributes); } return null; }  @Autowired void setPersonAttributeDao(IPersonAttributeDao personAttributeDao); @Autowired void setPortletWindowRegistry(IPortletWindowRegistry portletWindowRegistry); @Autowired void setPortletDefinitionRegistry(IPortletDefinitionRegistry portletDefinitionRegistry); @Override Object getAttribute(
            HttpServletRequest httpServletRequest,
            PortletWindow plutoPortletWindow,
            String attributeName);  }