1

I've a setup with Square Retrofit + Otto.

On API call success or failure Otto notifies the subscribing object.

I'm trying to write unit tests without mocking request/response.

But I don't seem to get any response or even Robolectric.httpRequestWasMade() returns false after the REST call is invoked

Can Robolectric make actual API calls and get their responses? Any help is appreciated.

dinidu
  • 183
  • 1
  • 6
  • 1
    You want the unit tests to hit the actual server? That seems like an integration test to me if you want it to be communicating with a live server. Are you sure you want to do that in a unit test? It will be unreliable and hard to use test data. I think you would be better served using Instrumentation/Robotium/Espresso if you want to talk to a live server than trying to use Robolectric. – swanson Jun 27 '14 at 18:28

0 Answers0