From be792abf5e540e79cccfb56157eced493d248ef4 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 17 May 2014 00:39:09 -0700 Subject: [PATCH] Migrate InputSupplier callers to ByteSource A future version of Guava will remove InputSupplier. --- .../internal/BaseGoogleComputeEngineExpectTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java index 1c360f23f0..6c7098efdc 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java @@ -27,7 +27,6 @@ import static org.jclouds.crypto.Pems.privateKeySpec; import static org.jclouds.crypto.Pems.publicKeySpec; import static org.jclouds.crypto.PemsTest.PRIVATE_KEY; import static org.jclouds.crypto.PemsTest.PUBLIC_KEY; -import static org.jclouds.io.Payloads.newStringPayload; import java.io.IOException; import java.net.URI; @@ -61,6 +60,7 @@ import org.jclouds.util.Strings2; import com.google.common.base.Joiner; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; +import com.google.common.io.ByteSource; import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.TypeLiteral; @@ -106,9 +106,9 @@ public class BaseGoogleComputeEngineExpectTest extends BaseRestApiExpectTest< binder.bind(new TypeLiteral>() {}).toInstance(Suppliers.ofInstance(0L)); try { KeyFactory keyfactory = KeyFactory.getInstance("RSA"); - PrivateKey privateKey = keyfactory.generatePrivate(privateKeySpec(newStringPayload - (PRIVATE_KEY))); - PublicKey publicKey = keyfactory.generatePublic(publicKeySpec(newStringPayload(PUBLIC_KEY))); + PrivateKey privateKey = keyfactory.generatePrivate(privateKeySpec(ByteSource.wrap( + PRIVATE_KEY.getBytes(UTF_8)))); + PublicKey publicKey = keyfactory.generatePublic(publicKeySpec(ByteSource.wrap(PUBLIC_KEY.getBytes(UTF_8)))); KeyPair keyPair = new KeyPair(publicKey, privateKey); openSshKey = SshKeys.encodeAsOpenSSH(RSAPublicKey.class.cast(publicKey)); final Crypto crypto = createMock(Crypto.class);