mirror of https://github.com/apache/jclouds.git
Changes to TemplateClientLiveTest following review. Test now passes without a java SSL certificate exception.
This commit is contained in:
parent
75752db64c
commit
e1bfb07780
|
@ -28,8 +28,7 @@ import org.testng.annotations.AfterGroups;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -132,18 +131,14 @@ public class TemplateClientLiveTest extends BaseCloudStackClientLiveTest {
|
||||||
assert jobComplete.apply(response.getJobId()) : template;
|
assert jobComplete.apply(response.getJobId()) : template;
|
||||||
|
|
||||||
// Get the result
|
// Get the result
|
||||||
AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobClient().<TemplateExtraction>getAsyncJob(response.getJobId());
|
AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobClient().getAsyncJob(response.getJobId());
|
||||||
TemplateExtraction extract = asyncJob.getResult();
|
TemplateExtraction extract = asyncJob.getResult();
|
||||||
assertNotNull(extract);
|
assertNotNull(extract);
|
||||||
|
|
||||||
// Check that the URL can be retrieved
|
// Check that the URL can be retrieved
|
||||||
String extractUrl = extract.getUrl();
|
String extractUrl = extract.getUrl();
|
||||||
assertNotNull(extractUrl);
|
assertNotNull(extractUrl);
|
||||||
URL url = new URL(URLDecoder.decode(extractUrl, "utf-8"));
|
URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
|
||||||
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
assertTrue(context.utils().http().exists(uri), "does not exist: " + uri);
|
||||||
connection.setRequestMethod("GET");
|
|
||||||
connection.connect();
|
|
||||||
assertEquals(connection.getResponseCode(), 200);
|
|
||||||
connection.disconnect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue