提交 7c810a5f 编写于 作者: M Marvin Froeder

Hardcode a github token for more stable testing

上级 69ab9c73
/** /**
* Copyright 2012-2019 The Feign Authors * Copyright 2012-2020 The Feign Authors
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at * in compliance with the License. You may obtain a copy of the License at
...@@ -28,8 +28,6 @@ import feign.gson.GsonEncoder; ...@@ -28,8 +28,6 @@ import feign.gson.GsonEncoder;
*/ */
public class GitHubExample { public class GitHubExample {
private static final String GITHUB_TOKEN = "GITHUB_TOKEN";
public interface GitHub { public interface GitHub {
public class Repository { public class Repository {
...@@ -81,14 +79,11 @@ public class GitHubExample { ...@@ -81,14 +79,11 @@ public class GitHubExample {
.logger(new Logger.ErrorLogger()) .logger(new Logger.ErrorLogger())
.logLevel(Logger.Level.BASIC) .logLevel(Logger.Level.BASIC)
.requestInterceptor(template -> { .requestInterceptor(template -> {
if (System.getenv().containsKey(GITHUB_TOKEN)) { template.header(
System.out.println("Detected Authorization token from environment variable"); // not available when building PRs...
template.header( // https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
// not available when building PRs... "Authorization",
// https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml "token 383f1c1b474d8f05a21e7964976ab0d403fee071");
"Authorization",
"token " + System.getenv(GITHUB_TOKEN));
}
}) })
.target(GitHub.class, "https://api.github.com"); .target(GitHub.class, "https://api.github.com");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册