use of org.wikipedia.random.RandomSummaryClient.Callback in project apps-android-wikipedia by wikimedia.
the class RandomSummaryClientTest method testRequestEligible.
@Test
public void testRequestEligible() throws Throwable {
enqueueFromFile("rb_page_summary_valid.json");
Callback cb = mock(Callback.class);
Call<RbPageSummary> call = request(cb);
server().takeRequest();
assertCallbackSuccess(call, cb);
}
use of org.wikipedia.random.RandomSummaryClient.Callback in project apps-android-wikipedia by wikimedia.
the class RandomSummaryClientTest method testRequestFailure.
@Test
public void testRequestFailure() throws Throwable {
enqueue404();
Callback cb = mock(Callback.class);
Call<RbPageSummary> call = request(cb);
server().takeRequest();
assertCallbackFailure(call, cb, IOException.class);
}
use of org.wikipedia.random.RandomSummaryClient.Callback in project apps-android-wikipedia by wikimedia.
the class RandomSummaryClientTest method testRequestMalformed.
@Test
public void testRequestMalformed() throws Throwable {
enqueueFromFile("rb_page_summary_malformed.json");
Callback cb = mock(Callback.class);
Call<RbPageSummary> call = request(cb);
server().takeRequest();
assertCallbackFailure(call, cb, JsonParseException.class);
}
Aggregations