ServletRequestParamReader extends AbstractParamReader { @Override public Object[] read() throws ServiceException { try { String requestBody = IoUtil.readStream(endpointsContext.getRequest().getInputStream()); logger.atFine().log("requestBody=%s", requestBody); if (requestBody == null || requestBody.trim().isEmpty()) { return new Object[0]; } JsonNode node = objectReader.readTree(requestBody); return deserializeParams(node); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | IOException e) { throw new BadRequestException(e); } } ServletRequestParamReader(
      EndpointMethod method,
      EndpointsContext endpointsContext,
      ServletContext servletContext,
      ApiSerializationConfig serializationConfig,
      ApiMethodConfig methodConfig); @Override Object[] read();  }
@Test public void testRead() throws Exception { Object[] params = readExecuteMethod(ImmutableMap.<String, String>builder() .put(TestEndpoint.NAME_STRING, "\"" + VALUE_STRING + "\"") .put(TestEndpoint.NAME_BOOLEAN, String.valueOf(VALUE_BOOLEAN)) .put(TestEndpoint.NAME_INTEGER, String.valueOf(VALUE_INTEGER)) .put(TestEndpoint.NAME_LONG, String.valueOf(VALUE_LONG)) .put(TestEndpoint.NAME_FLOAT, String.valueOf(VALUE_FLOAT)) .put(TestEndpoint.NAME_DOUBLE, String.valueOf(VALUE_DOUBLE)) .put(TestEndpoint.NAME_BOOLEAN_OBJECT, String.valueOf(VALUE_BOOLEAN)) .put(TestEndpoint.NAME_INTEGER_OBJECT, String.valueOf(VALUE_INTEGER)) .put(TestEndpoint.NAME_LONG_OBJECT, String.valueOf(VALUE_LONG)) .put(TestEndpoint.NAME_FLOAT_OBJECT, String.valueOf(VALUE_FLOAT)) .put(TestEndpoint.NAME_DOUBLE_OBJECT, String.valueOf(VALUE_DOUBLE)) .put("stringValue", "321") .put("integerValue", "321") .put("more", "999").build()); assertEquals(VALUE_STRING, params[0]); assertEquals(VALUE_BOOLEAN, params[1]); assertEquals(VALUE_INTEGER, params[2]); assertEquals(VALUE_LONG, params[3]); assertEquals(VALUE_FLOAT, params[4]); assertEquals(VALUE_DOUBLE, params[5]); assertEquals(VALUE_BOOLEAN, params[6]); assertEquals(VALUE_INTEGER, params[7]); assertEquals(VALUE_LONG, params[8]); assertEquals(VALUE_FLOAT, params[9]); assertEquals(VALUE_DOUBLE, params[10]); assertEquals("321", ((Request) params[11]).getStringValue()); assertEquals(321, (int) ((Request) params[11]).getIntegerValue()); assertEquals(USER, params[12]); assertEquals(APP_ENGINE_USER, params[13]); assertEquals(request, params[14]); }