@Test public void getPropertiesWhenConflict() { final javax.portlet.PortletRequest portletRequest = mockery.mock(javax.portlet.PortletRequest.class); this.mockery.checking(new Expectations() {{ oneOf(portletRequest).getParameterValues("key"); will(returnValue(new String[] {"value"})); oneOf(portletRequest).getAttribute("key"); will(returnValue("value")); }}); PortletRequest request = new PortletRequest(portletRequest); List<Object> values = request.getProperties("key"); Assert.assertEquals(Arrays.asList("value", "value"), values); }
@Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; }
PortletRequest implements Request { @Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; } }
PortletRequest implements Request { @Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; } PortletRequest(javax.portlet.PortletRequest portletRequest); }
PortletRequest implements Request { @Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; } PortletRequest(javax.portlet.PortletRequest portletRequest); javax.portlet.PortletRequest getPortletRequest(); @Override Object getProperty(String key); @Override List<Object> getProperties(String key); @Override void setProperty(String key, Object value); @Override void removeProperty(String key); }
PortletRequest implements Request { @Override public List<Object> getProperties(String key) { List<Object> result = new ArrayList<Object>(); result.addAll(Arrays.asList(this.portletRequest.getParameterValues(key))); result.add(this.portletRequest.getAttribute(key)); return result; } PortletRequest(javax.portlet.PortletRequest portletRequest); javax.portlet.PortletRequest getPortletRequest(); @Override Object getProperty(String key); @Override List<Object> getProperties(String key); @Override void setProperty(String key, Object value); @Override void removeProperty(String key);  }