Skip to content

Commit d79daab

Browse files
committed
Hardcode a github token for more stable testing
1 parent 03b1554 commit d79daab

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

example-github/src/main/java/example/github/GitHubExample.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2019 The Feign Authors
2+
* Copyright 2012-2020 The Feign Authors
33
*
44
* <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55
* except in compliance with the License. You may obtain a copy of the License at
@@ -26,8 +26,6 @@
2626
/** Inspired by {@code com.example.retrofit.GitHubClient} */
2727
public class GitHubExample {
2828

29-
private static final String GITHUB_TOKEN = "GITHUB_TOKEN";
30-
3129
public interface GitHub {
3230

3331
public class Repository {
@@ -78,13 +76,10 @@ static GitHub connect() {
7876
.logLevel(Logger.Level.BASIC)
7977
.requestInterceptor(
8078
template -> {
81-
if (System.getenv().containsKey(GITHUB_TOKEN)) {
82-
System.out.println("Detected Authorization token from environment variable");
83-
template.header(
84-
// not available when building PRs...
85-
// https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
86-
"Authorization", "token " + System.getenv(GITHUB_TOKEN));
87-
}
79+
template.header(
80+
// not available when building PRs...
81+
// https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
82+
"Authorization", "token 383f1c1b474d8f05a21e7964976ab0d403fee071");
8883
})
8984
.target(GitHub.class, "https://api.github.com");
9085
}

0 commit comments

Comments
 (0)