@Test(groups = "unit", testName = "BulkApiMockTest")
public class BulkApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
public void testExtractArchive() throws Exception {
GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
StringAsset content = new StringAsset("foo");
for (int i = 0; i < 10; i++) {
files.add(content, "/file" + i);
}
byte[] tarGz = ByteStreams2.toByteArrayAndClose(files.as(TarGzExporter.class).exportAsInputStream());
MockWebServer server = mockOpenStackServer();
server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));