unit test fixes

This commit is contained in:
Dmitri Babaev 2011-04-22 18:01:59 +04:00
parent 4198f23f4b
commit 27c1162eaf
4 changed files with 7 additions and 7 deletions

View File

@ -387,9 +387,9 @@ public class NovaAsyncClientTest extends RestClientTest<NovaAsyncClient> {
Method method = NovaAsyncClient.class.getMethod("changeAdminPass", int.class, String.class);
HttpRequest request = processor.createRequest(method, 2, "foo");
assertRequestLineEquals(request, "PUT http://endpoint/vapiversion/servers/2 HTTP/1.1");
assertRequestLineEquals(request, "POST http://endpoint/vapiversion/servers/2/action HTTP/1.1");
assertNonPayloadHeadersEqual(request, "");
assertPayloadEquals(request, "{\"server\":{\"adminPass\":\"foo\"}}", MediaType.APPLICATION_JSON, false);
assertPayloadEquals(request, "{\"changePassword\":{\"adminPass\":\"foo\"}}", MediaType.APPLICATION_JSON, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);

View File

@ -50,7 +50,7 @@ public class NovaImageToImageTest {
.operatingSystem(
new OperatingSystem.Builder().family(OsFamily.CENTOS).version("5.2").description("CentOS 5.2").is64Bit(true)
.build()).description("CentOS 5.2").defaultCredentials(new Credentials("root", null))
.ids("1").version("1286712000000").uri(new URI("https://servers.api.rackspacecloud.com/v1.1/1234/images/1")).build();
.ids("2").version("1286712000000").uri(new URI("https://servers.api.rackspacecloud.com/v1.1/1234/images/1")).build();
Image parsedImage = convertImage();
assertEquals(parsedImage, image);

View File

@ -119,7 +119,7 @@ public class ServerToNodeMetadataTest {
NodeMetadata metadata = parser.apply(server);
NodeMetadata constructedMetadata = newNodeMetadataBuilder()
.imageId("1")
.imageId("2")
.operatingSystem(new OperatingSystem.Builder()
.family(OsFamily.CENTOS)
.description("CentOS 5.2")
@ -145,7 +145,7 @@ public class ServerToNodeMetadataTest {
NodeMetadata metadata = parser.apply(server);
NodeMetadata constructedMetadata = newNodeMetadataBuilder()
.imageId("1")
.imageId("2")
.operatingSystem(new OperatingSystem.Builder()
.family(OsFamily.CENTOS)
.description("CentOS 5.2")

View File

@ -45,7 +45,7 @@ public class CreateServerOptionsTest {
public void testAddPayloadToRequestMapOfStringStringHttpRequest() {
CreateServerOptions options = new CreateServerOptions();
HttpRequest request = buildRequest(options);
assertEquals("{\"server\":{\"name\":\"foo\",\"imageRef\":1,\"flavorRef\":2}}", request.getPayload().getRawContent());
assertEquals("{\"server\":{\"name\":\"foo\",\"imageRef\":\"1\",\"flavorRef\":\"2\"}}", request.getPayload().getRawContent());
}
private HttpRequest buildRequest(CreateServerOptions options) {
@ -72,7 +72,7 @@ public class CreateServerOptionsTest {
private void assertFile(HttpRequest request) {
assertEquals(request.getPayload().getRawContent(),
"{\"server\":{\"name\":\"foo\",\"imageRef\":1,\"flavorRef\":2,\"personality\":[{\"path\":\"/tmp/rhubarb\",\"contents\":\"Zm9v\"}]}}");
"{\"server\":{\"name\":\"foo\",\"imageRef\":\"1\",\"flavorRef\":\"2\",\"personality\":[{\"path\":\"/tmp/rhubarb\",\"contents\":\"Zm9v\"}]}}");
}
@Test