RequestParametersJson extends RequestParameters { @Override public String getString(final String parameter) { return (String) getValue(parameter); } RequestParametersJson(final Representation request); @Override String getString(final String parameter); @Override List<?> getList(final String parameter); @Override Object[] getArray(final String parameter);  }
@Test public void getStringReturnsJsonString() throws Exception { testJSON = new JSONObject(); testJSON.put(testKey, testString); final Representation request = mockedJsonRequest(testJSON.toString()); classUnderTest = new RequestParametersJson(request); assertEquals(testString, classUnderTest.getString(testKey)); }