try {
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", anybodyRead().metadata(metadata)));
Container container = api.containerApiInRegion("DFW").head("myContainer");
assertEquals(container.getName(), "myContainer");
assertEquals(container.getObjectCount(), 42l);
assertEquals(container.getBytesUsed(), 323479l);
for (Entry<String, String> entry : container.getMetadata().entrySet()) {
assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
}
assertEquals(server.getRequestCount(), 3);
assertAuthentication(server);
assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");
assertRequest(server.takeRequest(), "HEAD", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer");