### Question:
ServletRequest implements Request { @Override public Object getProperty(String key) { Object result; result = this.httpServletRequest.getParameter(key); if (result == null) { result = this.httpServletRequest.getAttribute(key); } return result; } ServletRequest(HttpServletRequest httpServletRequest); HttpServletRequest getHttpServletRequest(); @Override Object getProperty(String key); @Override List<Object> getProperties(String key); @Override void setProperty(String key, Object value); @Override void removeProperty(String key);  }### Answer:
@Test public void getPropertyWhenNoExistAsRequestParam() { when(this.httpRequest.getParameter("key")).thenReturn("value"); ServletRequest request = new ServletRequest(this.httpRequest); assertEquals("value", request.getProperty("key")); }
@Test public void getPropertyWhenNoExistAsAttributeParam() { when(this.httpRequest.getParameter("key")).thenReturn(null); when(this.httpRequest.getAttribute("key")).thenReturn("value"); ServletRequest request = new ServletRequest(this.httpRequest); assertEquals("value", request.getProperty("key")); }