VolleyX { public static void init(Context context) { if (context == null) throw new NullPointerException("context can not be null"); sContext = context; DEFAULT_REQUESTQUEUE = Volley.newRequestQueue(sContext); sRequestQueue = DEFAULT_REQUESTQUEUE; sInited = true; }  static void init(Context context); static Observable<T> from(final Request<T> request); static Observable<T> from(final Request<T> request, final String listernerField); static void setRequestQueue(RequestQueue queue); static RequestQueue DEFAULT_REQUESTQUEUE; }
@Test public void testInit_context_null() throws Exception { thrown.expect(NullPointerException.class); VolleyX.init(null); }
@Test public void testInit_context() throws Exception { VolleyX.init(RuntimeEnvironment.application); assertThat(VolleyX.DEFAULT_REQUESTQUEUE, is(not(nullValue()))); assertThat(VolleyX.sRequestQueue, is(not(nullValue()))); assertThat(VolleyX.sContext, is(not(nullValue()))); assertThat(VolleyX.sInited, is(true)); }