LoginServiceImpl extends BaseRetrofitService<LoginRepository> implements org.unicef.rapidreg.service
        .LoginService { @Override public boolean isUrlValid(String url) { return !TextUtils.isEmpty(url) && Patterns.WEB_URL.matcher(url).matches(); } LoginServiceImpl(ConnectivityManager connectivityManager,
                            TelephonyManager telephonyManager,
                            UserDao userDao); @Override boolean isOnline(); @Override void loginOnline(final String username,
                            final String password,
                            final String url,
                            String imei,
                            final LoginCallback callback); @Override void loginOffline(String username, String password, String url, LoginCallback callback); @Override void destroy(); @Override String loadLastLoginServerUrl(); @Override boolean isUsernameValid(String username); @Override boolean isPasswordValid(String password); @Override boolean isUrlValid(String url);  }
@Test public void should_return_false_when_url_is_invalid() { assertThat(loginService.isUrlValid(null), CoreMatchers.is(false)); assertThat(loginService.isUrlValid(""), CoreMatchers.is(false)); assertThat(loginService.isUrlValid("http assertThat(loginService.isUrlValid("http: }
@Test public void should_return_true_when_url_is_valid() throws Exception { assertThat("should return url is true", loginService.isUrlValid("http: }