From d19a95615a55195f6e24e8dbd394aad6dfc28841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Andr=C3=A9=20Martins?= Date: Wed, 13 Jul 2016 14:46:05 -0400 Subject: [PATCH] Make getSdkPath public for testing. --- .../google/cloud/tools/appengine/cloudsdk/CloudSdk.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/cloud/tools/appengine/cloudsdk/CloudSdk.java b/src/main/java/com/google/cloud/tools/appengine/cloudsdk/CloudSdk.java index 98aa7a4ea..55a00e5a1 100644 --- a/src/main/java/com/google/cloud/tools/appengine/cloudsdk/CloudSdk.java +++ b/src/main/java/com/google/cloud/tools/appengine/cloudsdk/CloudSdk.java @@ -25,6 +25,7 @@ import com.google.cloud.tools.appengine.cloudsdk.process.ProcessExitListener; import com.google.cloud.tools.appengine.cloudsdk.process.ProcessOutputLineListener; import com.google.cloud.tools.appengine.cloudsdk.process.ProcessStartListener; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.collect.Maps; @@ -174,7 +175,7 @@ private void logCommand(List command) { logger.info("submitting command: " + WHITESPACE_JOINER.join(command)); } - private Path getSdkPath() { + @VisibleForTesting public Path getSdkPath() { return sdkPath; } @@ -194,7 +195,7 @@ public Path getJavaAppEngineSdkPath() { return getSdkPath().resolve(JAVA_APPENGINE_SDK_PATH); } - private Path getJavaToolsJar() { + public Path getJavaToolsJar() { return getJavaAppEngineSdkPath().resolve(JAVA_TOOLS_JAR); } @@ -252,9 +253,9 @@ public static class Builder { * The home directory of Google Cloud SDK. If not set, will attempt to look for the SDK in known * install locations. */ - public Builder sdkPath(File sdkPathFile) { + public Builder sdkPath(Path sdkPathFile) { if (sdkPathFile != null) { - this.sdkPath = sdkPathFile.toPath(); + this.sdkPath = sdkPathFile; } return this; }