Created
January 10, 2014 19:09
-
-
Save jdaggett/8360532 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(expectedExceptions = CopyObjectException.class) | |
public void copyObjectFail() throws InterruptedException, IOException { | |
MockWebServer server = mockOpenStackServer(); | |
server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); | |
server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404) | |
.addHeader(SwiftHeaders.OBJECT_COPY_FROM, "/bogus/foo.txt"))); | |
try { | |
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift"); | |
// the following line will throw the CopyObjectException | |
api.objectApiInRegionForContainer("DFW", "foo").copy("bar.txt", "bogus", "foo.txt"); | |
} finally { | |
server.shutdown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment