android.support.annotation.VisibleForTesting#PRIVATE源码实例Demo

下面列出了android.support.annotation.VisibleForTesting#PRIVATE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: quill   文件: NetworkBlogUrlValidator.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static Single<String> checkGhostBlog(@NonNull String blogUrl,
                                     @NonNull OkHttpClient client) {
    final String adminPagePath = "/ghost/";
    String adminPageUrl = NetworkUtils.makeAbsoluteUrl(blogUrl, adminPagePath);
    return checkUrl(adminPageUrl, client).flatMap(response -> {
        if (response.isSuccessful()) {
            // the request may have been redirected, most commonly from HTTP => HTTPS
            // so pick up the eventual URL of the blog and use that
            // (even if the user manually entered HTTP - it's certainly a mistake)
            // to get that, chop off the admin page path from the end
            String potentiallyRedirectedUrl = response.request().url().toString();
            String finalBlogUrl = potentiallyRedirectedUrl.replaceFirst(adminPagePath + "?$", "");
            return Single.just(finalBlogUrl);
        } else if (response.code() == HttpURLConnection.HTTP_NOT_FOUND) {
            return Single.error(new UrlNotFoundException(blogUrl));
        } else {
            return Single.error(new RuntimeException("Response code " + response.code()
                    + " on requesting admin page at " + adminPageUrl));
        }
   });
}
 
源代码2 项目: quill   文件: LoginOrchestrator.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
LoginOrchestrator(BlogUrlValidator blogUrlValidator, ApiProviderFactory apiProviderFactory,
                  CredentialSource credentialSource, CredentialSink credentialSink,
                  HACKListener hackListener) {
    mBlogUrlValidator = blogUrlValidator;
    mApiProviderFactory = apiProviderFactory;
    mCredentialSource = credentialSource;
    mCredentialSink = credentialSink;
    mHACKListener = hackListener;
    mListeners = new HashSet<>();
    reset();
}
 
源代码3 项目: quill   文件: AuthService.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
AuthService(String blogUrl, GhostApiService api,
            CredentialSource credSource, CredentialSink credSink) {
    mBlogUrl = blogUrl;
    mApi = api;
    mCredentialSource = credSource;
    mCredentialSink = credSink;
}
 
源代码4 项目: Spork   文件: ExampleApplication.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public void setObjectGraph(ObjectGraph objectGraph) {
	this.objectGraph = objectGraph;
}
 
源代码5 项目: mangosta-android   文件: TimeCalculation.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static boolean isMinutesDiffMax(DateTime dateTime1, DateTime dateTime2, int maxMinutes) {
    Period period = new Period(dateTime1, dateTime2);
    Duration duration = period.toDurationFrom(dateTime1);
    return Math.abs(duration.toStandardMinutes().getMinutes()) <= maxMinutes;
}
 
源代码6 项目: quill   文件: LoginOrchestrator.java
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static String normalizeBlogUrl(String inputBlogUrl) {
    return inputBlogUrl.trim().replaceFirst("^(.*)/ghost/?$", "$1");
}
 
 同类方法