| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 42c9906 commit 3101a02
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + :: See documentation in type-shell-output.bat | ||
| 2 | + | ||
| 3 | + "C:\Program Files\Git\bin\bash.exe" github/google-auth-library-java/.kokoro/build.sh | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + # Format: //devtools/kokoro/config/proto/build.proto | ||
| 2 | + | ||
| 3 | + build_file: "google-auth-library-java/.kokoro/build.sh" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + # Format: //devtools/kokoro/config/proto/build.proto | ||
| 2 | + | ||
| 3 | + build_file: "google-auth-library-java/.kokoro/build.bat" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,6 +53,7 @@ | |||
| 53 | 53 | import java.io.IOException; | |
| 54 | 54 | import java.io.InputStream; | |
| 55 | 55 | import java.net.URI; | |
| 56 | + import java.nio.file.Paths; | ||
| 56 | 57 | import java.security.AccessControlException; | |
| 57 | 58 | import java.util.Collection; | |
| 58 | 59 | import java.util.Collections; | |
@@ -136,7 +137,7 @@ public void getDefaultCredentials_envValidSandbox_throwsNonSecurity() throws Exc | |||
| 136 | 137 | UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); | |
| 137 | 138 | TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); | |
| 138 | 139 | testProvider.setFileSandbox(true); | |
| 139 | - String userPath = "/user.json"; | ||
| 140 | + String userPath = tempFilePath("user.json"); | ||
| 140 | 141 | testProvider.addFile(userPath, userStream); | |
| 141 | 142 | testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); | |
| 142 | 143 | ||
@@ -300,7 +301,7 @@ public void getDefaultCredentials_envServiceAccount_providesToken() throws IOExc | |||
| 300 | 301 | .writeServiceAccountStream( | |
| 301 | 302 | SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID); | |
| 302 | 303 | TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); | |
| 303 | - String serviceAccountPath = "/service_account.json"; | ||
| 304 | + String serviceAccountPath = tempFilePath("service_account.json"); | ||
| 304 | 305 | testProvider.addFile(serviceAccountPath, serviceAccountStream); | |
| 305 | 306 | testProvider.setEnv( | |
| 306 | 307 | DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, serviceAccountPath); | |
@@ -318,7 +319,7 @@ public void getDefaultCredentials_envUser_providesToken() throws IOException { | |||
| 318 | 319 | InputStream userStream = | |
| 319 | 320 | UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); | |
| 320 | 321 | TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); | |
| 321 | - String userPath = "/user.json"; | ||
| 322 | + String userPath = tempFilePath("user.json"); | ||
| 322 | 323 | testProvider.addFile(userPath, userStream); | |
| 323 | 324 | testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); | |
| 324 | 325 | ||
@@ -420,7 +421,7 @@ public void getDefaultCredentials_envAndWellKnownFile_envPrecedence() throws IOE | |||
| 420 | 421 | ||
| 421 | 422 | InputStream envStream = | |
| 422 | 423 | UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, refreshTokenEnv); | |
| 423 | - String envPath = "/env.json"; | ||
| 424 | + String envPath = tempFilePath("env.json"); | ||
| 424 | 425 | testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, envPath); | |
| 425 | 426 | testProvider.addFile(envPath, envStream); | |
| 426 | 427 | ||
@@ -443,6 +444,10 @@ public void getDefaultCredentials_envAndWellKnownFile_envPrecedence() throws IOE | |||
| 443 | 444 | testUserProvidesToken(testProvider, transportFactory, accessTokenEnv); | |
| 444 | 445 | } | |
| 445 | 446 | ||
| 447 | + private String tempFilePath(String filename) { | ||
| 448 | + return Paths.get(System.getProperty("java.io.tmpdir"), filename).toString(); | ||
| 449 | + } | ||
| 450 | + | ||
| 446 | 451 | private class LogHandler extends Handler { | |
| 447 | 452 | LogRecord lastRecord; | |
| 448 | 453 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments