test_class.declarator: loginPresenter
test_class.modifier: @Inject
test_class.original_string: @Inject
      LoginPresenter loginPresenter;
test_class.type: LoginPresenter
test_class.var_name: loginPresenter
test_class.declarator: context
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Context context;
test_class.type: Context
test_class.var_name: context
test_class.declarator: loginService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LoginService loginService;
test_class.type: LoginService
test_class.var_name: loginService
test_class.declarator: systemSettingService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SystemSettingsService systemSettingService;
test_class.type: SystemSettingsService
test_class.var_name: systemSettingService
test_class.declarator: loginView
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LoginView loginView;
test_class.type: LoginView
test_class.var_name: loginView
test_class.file: app/src/test/java/org/unicef/rapidreg/login/LoginPresenterTest.java
test_class.identifier: LoginPresenterTest
test_case.body: @Test
      public void should_show_error_when_invalid_user_format() {
          when(loginService.isUsernameValid("pri mero")).thenReturn(false);
          when(loginService.isPasswordValid("password")).thenReturn(true);
          when(loginService.isUrlValid("http://10.29.3.184:3000")).thenReturn(true);
  
          boolean valid = loginPresenter.validate("pri mero", "password", "http://10.29.3.184:3000");
          verify(loginView).showUserNameInvalid();
          assertEquals(valid, false);
      }
test_case.class_method_signature: LoginPresenterTest.should_show_error_when_invalid_user_format()
test_case.full_signature: @Test public void should_show_error_when_invalid_user_format()
test_case.identifier: should_show_error_when_invalid_user_format
test_case.invocations: thenReturn when isUsernameValid thenReturn when isPasswordValid thenReturn when isUrlValid validate showUserNameInvalid verify assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_show_error_when_invalid_user_format()
focal_class.declarator: TAG = LoginPresenter.class.getSimpleName()
focal_class.modifier: public static final
focal_class.original_string: public static final String TAG = LoginPresenter.class.getSimpleName();
focal_class.type: String
focal_class.var_name: TAG
focal_class.declarator: loginService
focal_class.modifier: private
focal_class.original_string: private LoginService loginService;
focal_class.type: LoginService
focal_class.var_name: loginService
focal_class.declarator: systemSettingsService
focal_class.modifier: private
focal_class.original_string: private SystemSettingsService systemSettingsService;
focal_class.type: SystemSettingsService
focal_class.var_name: systemSettingsService
focal_class.file: app/src/main/java/org/unicef/rapidreg/login/LoginPresenter.java
focal_class.identifier: LoginPresenter
focal_class.class_method_signature: LoginPresenter.LoginPresenter(Lazy<LoginService> loginService, Lazy<SystemSettingsService> systemSettingsServiceLazy)
focal_class.full_signature: @Inject public  LoginPresenter(Lazy<LoginService> loginService, Lazy<SystemSettingsService> systemSettingsServiceLazy)
focal_class.identifier: LoginPresenter
focal_class.modifiers: @Inject public
focal_class.parameters: (Lazy<LoginService> loginService, Lazy<SystemSettingsService> systemSettingsServiceLazy)
focal_class.signature:  LoginPresenter(Lazy<LoginService> loginService, Lazy<SystemSettingsService> systemSettingsServiceLazy)
focal_class.class_method_signature: LoginPresenter.loadLastLoginUrl()
focal_class.full_signature: public String loadLastLoginUrl()
focal_class.identifier: loadLastLoginUrl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String loadLastLoginUrl()
focal_class.class_method_signature: LoginPresenter.doLogin(String username, String password, String url, String imei)
focal_class.full_signature: public void doLogin(String username, String password, String url, String imei)
focal_class.identifier: doLogin
focal_class.modifiers: public
focal_class.parameters: (String username, String password, String url, String imei)
focal_class.return: void
focal_class.signature: void doLogin(String username, String password, String url, String imei)
focal_class.class_method_signature: LoginPresenter.validate(String username, String password, String url)
focal_class.full_signature: public boolean validate(String username, String password, String url)
focal_class.identifier: validate
focal_class.modifiers: public
focal_class.parameters: (String username, String password, String url)
focal_class.return: boolean
focal_class.signature: boolean validate(String username, String password, String url)
focal_class.class_method_signature: LoginPresenter.attachView(LoginView view)
focal_class.full_signature: @Override public void attachView(LoginView view)
focal_class.identifier: attachView
focal_class.modifiers: @Override public
focal_class.parameters: (LoginView view)
focal_class.return: void
focal_class.signature: void attachView(LoginView view)
focal_class.class_method_signature: LoginPresenter.detachView(boolean retainInstance)
focal_class.full_signature: @Override public void detachView(boolean retainInstance)
focal_class.identifier: detachView
focal_class.modifiers: @Override public
focal_class.parameters: (boolean retainInstance)
focal_class.return: void
focal_class.signature: void detachView(boolean retainInstance)
focal_class.class_method_signature: LoginPresenter.doLoginOnline(final String username,
                                 final String password,
                                 final String url,
                                 String imei)
focal_class.full_signature: private void doLoginOnline(final String username,
                                 final String password,
                                 final String url,
                                 String imei)
focal_class.identifier: doLoginOnline
focal_class.modifiers: private
focal_class.parameters: (final String username,
                                 final String password,
                                 final String url,
                                 String imei)
focal_class.return: void
focal_class.signature: void doLoginOnline(final String username,
                                 final String password,
                                 final String url,
                                 String imei)
focal_class.class_method_signature: LoginPresenter.sendLoadFormEvent(User.Role roleType, String cookie)
focal_class.full_signature: private void sendLoadFormEvent(User.Role roleType, String cookie)
focal_class.identifier: sendLoadFormEvent
focal_class.modifiers: private
focal_class.parameters: (User.Role roleType, String cookie)
focal_class.return: void
focal_class.signature: void sendLoadFormEvent(User.Role roleType, String cookie)
focal_class.class_method_signature: LoginPresenter.doLoginOffline(String username, String password, String url)
focal_class.full_signature: private void doLoginOffline(String username, String password, String url)
focal_class.identifier: doLoginOffline
focal_class.modifiers: private
focal_class.parameters: (String username, String password, String url)
focal_class.return: void
focal_class.signature: void doLoginOffline(String username, String password, String url)
focal_class.superclass: extends MvpBasePresenter<LoginView>
focal_method.body: public boolean validate(String username, String password, String url) {
          boolean isValid = true;
          if (!loginService.isUsernameValid(username)) {
              getView().showUserNameInvalid();
              isValid = false;
          }
          if (!loginService.isUsernameValid(password)) {
              getView().showPasswordInvalid();
              isValid = false;
          }
  
          if (!loginService.isUrlValid(url)) {
              getView().showUrlInvalid();
              isValid = false;
          }
          return isValid;
      }
focal_method.class_method_signature: LoginPresenter.validate(String username, String password, String url)
focal_method.full_signature: public boolean validate(String username, String password, String url)
focal_method.identifier: validate
focal_method.invocations: isUsernameValid showUserNameInvalid getView isUsernameValid showPasswordInvalid getView isUrlValid showUrlInvalid getView
focal_method.modifiers: public
focal_method.parameters: (String username, String password, String url)
focal_method.return: boolean
focal_method.signature: boolean validate(String username, String password, String url)