Guest User

Untitled

a guest
Nov 30th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. @Test
  2. public void loginUserAccount() {
  3. NetworkHelper.MOCK_URL =
  4.  
  5. String userName = "abacus@hotmail.com";
  6. String password = "abacus#112";
  7. boolean keepMeLoggedInChecked = false;
  8. boolean touchIdEnabled = false;
  9. boolean optIn = false;
  10.  
  11. mAuthenticationService.logIn(userName, password, keepMeLoggedInChecked, touchIdEnabled, optIn).done(new DoneCallback<LogInResponse>() {
  12. @Override
  13. public void onDone(final LogInResponse result) {
  14. Assert.assertEquals(true,true);
  15. }
  16. }).fail(new FailCallback<Throwable>() {
  17. @Override
  18. public void onFail(Throwable result) {
  19. Assert.assertEquals(true,false);
  20. }
  21. });
  22. }
  23.  
  24. public class NetworkHelper {
  25. private final OkHttpClient mOkHttpClient;
  26.  
  27. public static HttpUrl MOCK_URL = null;
  28. public NetworkHelper(OkHttpClient httpClient) {
  29. mOkHttpClient = httpClient;
  30. }
  31.  
  32. public Retrofit initialize(String baseUrl) {
  33. if(MOCK_URL!=null) {
  34. Retrofit retrofit = new Retrofit.Builder()
  35. .baseUrl(MOCK_URL)
  36. .addConverterFactory(JacksonConverterFactory.create())
  37. .client(mOkHttpClient)
  38. .build();
  39.  
  40. return retrofit;
Add Comment
Please, Sign In to add comment