vcloud-director: fixing expect tests that were incorrectly passing due to missing requestline check in BaseRestClientExpectTest

This commit is contained in:
Adam Lowe 2012-05-10 15:09:35 +01:00
parent f11518fa1e
commit 305a593d9a
5 changed files with 7 additions and 7 deletions

View File

@ -80,7 +80,7 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test
public void testCloneMedia() {
URI cloneUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia");
URI vdcURI = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
@ -105,7 +105,7 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
.build();
Media expected = cloneMedia();
assertEquals(client.getMediaClient().cloneMedia(cloneUri, params), expected);
assertEquals(client.getMediaClient().cloneMedia(vdcURI, params), expected);
}
@Test

View File

@ -394,7 +394,7 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadata.xml", METADATA).httpResponseBuilder().build(),
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
).getVAppTemplateClient();
@ -425,7 +425,7 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
URI uri = URI.create(endpoint + templateId);
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
client.getMetadataClient().mergeMetadata(uri, exampleMetadata());

View File

@ -53,7 +53,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
public void testCreateCatalog() {
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/catalogs")
.apiCommand("POST", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/catalogs")
.xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
.acceptMedia(VCloudDirectorMediaType.ADMIN_CATALOG)
.httpRequestBuilder().build(),

View File

@ -66,7 +66,7 @@ public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpec
public void testUpdateNetwork() {
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
.apiCommand("PUT", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
.xmlFilePayload("/network/admin/updateNetworkSource.xml", VCloudDirectorMediaType.ORG_NETWORK)
.acceptMedia(VCloudDirectorMediaType.TASK)
.httpRequestBuilder().build(),

View File

@ -52,7 +52,7 @@ public class UserClientExpectTest extends VCloudDirectorAdminClientExpectTest {
public void testCreateUser() {
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/catalogs")
.apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/users")
.xmlFilePayload("/user/createUserSource.xml", VCloudDirectorMediaType.USER)
.acceptMedia(VCloudDirectorMediaType.USER)
.httpRequestBuilder().build(),