SessionScopeExtractor implements AttributeExtractor { @Override public void removeValue(String name) { PortletSession session = request.getPortletSession(false); if (session != null) { session.removeAttribute(name, scope); } } SessionScopeExtractor(PortletRequest request, int scope); @Override void setValue(String name, Object value); @Override void removeValue(String name); @Override Enumeration<String> getKeys(); @Override Object getValue(String key);  }
@Test public void testRemoveValue() { expect(request.getPortletSession(false)).andReturn(session); session.removeAttribute("name", PortletSession.PORTLET_SCOPE); replay(request, session); extractor.removeValue("name"); verify(request, session); }