use of org.jclouds.openstack.swift.v1.domain.SwiftObject in project druid by druid-io.
the class CloudFilesObjectApiProxyTest method getTest.
@Test
public void getTest() {
final String path = "path";
final String region = "region";
final String container = "container";
CloudFilesApi cloudFilesApi = createMock(CloudFilesApi.class);
ObjectApi objectApi = createMock(ObjectApi.class);
SwiftObject swiftObject = createMock(SwiftObject.class);
Payload payload = createMock(Payload.class);
expect(cloudFilesApi.getObjectApi(region, container)).andReturn(objectApi);
expect(objectApi.get(path)).andReturn(swiftObject);
expect(swiftObject.getPayload()).andReturn(payload);
replayAll();
CloudFilesObjectApiProxy cfoApiProxy = new CloudFilesObjectApiProxy(cloudFilesApi, region, container);
CloudFilesObject cloudFilesObject = cfoApiProxy.get(path);
assertEquals(cloudFilesObject.getPayload(), payload);
assertEquals(cloudFilesObject.getRegion(), region);
assertEquals(cloudFilesObject.getContainer(), container);
assertEquals(cloudFilesObject.getPath(), path);
verifyAll();
}
use of org.jclouds.openstack.swift.v1.domain.SwiftObject in project druid by druid-io.
the class CloudFilesObjectApiProxy method get.
public CloudFilesObject get(String path) {
SwiftObject swiftObject = objectApi.get(path);
Payload payload = swiftObject.getPayload();
return new CloudFilesObject(payload, this.region, this.container, path);
}
Aggregations