@Test public void testParsingWithTextDataWithWhitespaces() throws Exception { final String data = "{\"id\": \"123\", \"type\" : \"text/plain\"}\n" + " This is just a plain text"; Reader r = new StringReader(data); JSONObject jsonpart = SimpleRestInterceptor.parseJsonPart(r); Map<String, Object> expectedHeaders = new HashMap<String, Object>(); expectedHeaders.put("id", "123"); expectedHeaders.put("type", "text/plain"); verify(jsonpart, r, expectedHeaders, "\n This is just a plain text"); }
protected static JSONObject parseJsonPart(Reader reader) throws JSONException { return (JSONObject)(new JSONTokener(reader).nextValue()); }
SimpleRestInterceptor extends AtmosphereInterceptorAdapter { protected static JSONObject parseJsonPart(Reader reader) throws JSONException { return (JSONObject)(new JSONTokener(reader).nextValue()); } }
SimpleRestInterceptor extends AtmosphereInterceptorAdapter { protected static JSONObject parseJsonPart(Reader reader) throws JSONException { return (JSONObject)(new JSONTokener(reader).nextValue()); } SimpleRestInterceptor(); }
SimpleRestInterceptor extends AtmosphereInterceptorAdapter { protected static JSONObject parseJsonPart(Reader reader) throws JSONException { return (JSONObject)(new JSONTokener(reader).nextValue()); } SimpleRestInterceptor(); @Override void configure(AtmosphereConfig config); @Override Action inspect(final AtmosphereResource r); }
SimpleRestInterceptor extends AtmosphereInterceptorAdapter { protected static JSONObject parseJsonPart(Reader reader) throws JSONException { return (JSONObject)(new JSONTokener(reader).nextValue()); } SimpleRestInterceptor(); @Override void configure(AtmosphereConfig config); @Override Action inspect(final AtmosphereResource r); final static String PROTOCOL_DETACHED_KEY; final static String X_ATMOSPHERE_SIMPLE_REST_PROTOCOL_DETACHED; final static String X_REQUEST_KEY; }