Robospice-retrofit testing
I am trying to do some unit testing using this robospice-retofit example . The problem is that I got some NullPointerException when I call the loadDataFromNetwork () method. Here's the test code
public class SampleRetrofitSpiceRequestTest extends InstrumentationTestCase {
private SampleRetrofitSpiceRequest sampleRetrofitSpiceRequest;
@Override
protected void setUp() throws Exception {
super.setUp();
sampleRetrofitSpiceRequest = new SampleRetrofitSpiceRequest(
"octo-online", "robospice");
}
public void test_loadDataFromNetwork() throws Exception {
List contributors = sampleRetrofitSpiceRequest.loadDataFromNetwork();
assertTrue(contributors.size() > 0);
}
}
+3
source to share