Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder();
requestResponseMap.put(getDatacenters, getDatacentersResponse);
requestResponseMap.put(datasets.list, datasets.listResponse);
requestResponseMap.put(packages.list, packages.listResponse);
HttpRequest createKey = HttpRequest.builder().method("POST")
.endpoint("https://api.joyentcloud.com/my/keys")
.addHeader("X-Api-Version", "~6.5")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
.payload(
payloadFromStringWithContentType(
"{\"name\":\"jclouds-test-0\",\"key\":\"" + keyPair.get("public") + "\"}",
"application/json")).build();
HttpResponse createKeyResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
.payload(payloadFromResourceWithContentType("/key.json", "application/json; charset=UTF-8"))
.build();
requestResponseMap.put(createKey, createKeyResponse);
// look for number to start count at
requestResponseMap.put(machines.list, machines.listResponse);
HttpRequest createMachine = HttpRequest.builder().method("POST")
.endpoint("https://us-sw-1.api.joyentcloud.com/my/machines?dataset=sdc%3Asdc%3Aubuntu-10.04%3A1.0.1&name=test-1&package=Small%201GB&metadata.jclouds-group=test")
.addHeader("X-Api-Version", "~6.5")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build();