SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", anybodyRead().metadata(metadata)));
assertEquals(server.getRequestCount(), 2);
assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
RecordedRequest createRequest = server.takeRequest();
assertEquals(createRequest.getRequestLine(),
"PUT /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer HTTP/1.1");
assertEquals(createRequest.getHeader("x-container-read"), ".r:*,.rlistings");
for (Entry<String, String> entry : metadata.entrySet()) {
assertEquals(createRequest.getHeader("x-container-meta-" + entry.getKey().toLowerCase()), entry.getValue());