Search in sources :

Example 1 with RetrofitSpiceRequestStub

use of com.octo.android.robospice.retrofit.test.stub.RetrofitSpiceRequestStub in project robospice by stephanenicolas.

the class RetrofitGsonSpiceServiceTest method test_addRequest_injects_request_factory.

public void test_addRequest_injects_request_factory() throws InterruptedException {
    // given
    spiceManager.start(getContext());
    RetrofitSpiceRequestStub retrofitSpiceRequestStub = new RetrofitSpiceRequestStub(WeatherResult.class);
    // when
    spiceManager.execute(retrofitSpiceRequestStub, new RequestListenerStub<WeatherResult>());
    retrofitSpiceRequestStub.await(REQUEST_COMPLETION_TIMEOUT);
    // test
    assertNotNull(retrofitSpiceRequestStub.getService());
}
Also used : WeatherResult(com.octo.android.robospice.retrofit.test.model.WeatherResult) RetrofitSpiceRequestStub(com.octo.android.robospice.retrofit.test.stub.RetrofitSpiceRequestStub)

Example 2 with RetrofitSpiceRequestStub

use of com.octo.android.robospice.retrofit.test.stub.RetrofitSpiceRequestStub in project robospice by stephanenicolas.

the class RetrofitJackson2SpiceServiceTest method test_addRequest_injects_request_factory.

public void test_addRequest_injects_request_factory() throws InterruptedException {
    // given
    spiceManager.start(getContext());
    RetrofitSpiceRequestStub retrofitSpiceRequestStub = new RetrofitSpiceRequestStub(WeatherResult.class);
    // when
    spiceManager.execute(retrofitSpiceRequestStub, new RequestListenerStub<WeatherResult>());
    retrofitSpiceRequestStub.await(REQUEST_COMPLETION_TIMEOUT);
    // test
    assertNotNull(retrofitSpiceRequestStub.getService());
}
Also used : WeatherResult(com.octo.android.robospice.retrofit.test.model.WeatherResult) RetrofitSpiceRequestStub(com.octo.android.robospice.retrofit.test.stub.RetrofitSpiceRequestStub)

Aggregations

WeatherResult (com.octo.android.robospice.retrofit.test.model.WeatherResult)2 RetrofitSpiceRequestStub (com.octo.android.robospice.retrofit.test.stub.RetrofitSpiceRequestStub)2