api.objectApiInRegionForContainer("DFW", "myContainer").replace("myObject",
newStringPayload("swifty"), metadata), "d9f5eb4bba4e2f2f046e54611bc8196b");
assertEquals(server.getRequestCount(), 2);
assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
RecordedRequest replace = server.takeRequest();
assertEquals(replace.getRequestLine(),
"PUT /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject HTTP/1.1");
assertEquals(new String(replace.getBody()), "swifty");
for (Entry<String, String> entry : metadata.entrySet()) {
assertEquals(replace.getHeader("x-object-meta-" + entry.getKey().toLowerCase()), entry.getValue());
}
} finally {
server.shutdown();
}
}