Created
January 28, 2015 05:41
-
-
Save NorseDreki/81d5a342f704d7088689 to your computer and use it in GitHub Desktop.
Example on how to test an Observable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testJson() throws Exception { | |
Observable<String> jsonObservable = MockResponse.generateJson(736L, 1, 1000, 5); | |
String json = jsonObservable.toBlocking().single(); | |
System.out.println(json); | |
assertTrue(json.startsWith("{\"responseKey\":" + MockResponse.getResponseKey(736L) + ",\"delay\":1,\"itemSize\":1000,\"numItems\":5,\"items\"")); | |
System.out.println("json: " + json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment