Created
March 1, 2019 13:49
-
-
Save aykuttasil/fc8e49413b7d5cc4e8857102796cea0e to your computer and use it in GitHub Desktop.
This file contains 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
final Dispatcher dispatcher = new Dispatcher() { | |
@Override | |
public MockResponse dispatch(RecordedRequest request) throws InterruptedException { | |
if (request.getPath().equals("/v1/login/auth/")){ | |
return new MockResponse().setResponseCode(200); | |
} else if (request.getPath().equals("v1/check/version/")){ | |
return new MockResponse().setResponseCode(200).setBody("version=9"); | |
} else if (request.getPath().equals("/v1/profile/info")) { | |
return new MockResponse().setResponseCode(200).setBody("{\\\"info\\\":{\\\"name\":\"Lucas Albuquerque\",\"age\":\"21\",\"gender\":\"male\"}}"); | |
} | |
return new MockResponse().setResponseCode(404); | |
} | |
}; | |
server.setDispatcher(dispatcher); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment