use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class PaginationResponseGenerator_Test method toParseResponsePayload_GetObjects_Test.
@Test
public void toParseResponsePayload_GetObjects_Test() {
final String expected = "if self.response.status == 200:\n" + " self.result = parseModel(xmldom.fromstring(response.read()), array())\n" + " self.paging_truncated = self.parse_int_header('page-truncated', response.getheaders())\n" + " self.paging_total_result_count = self.parse_int_header('total-result-count', response.getheaders())";
final Ds3Request ds3Request = getObjectsDetailsRequest();
assertThat(generator.toParseResponsePayload(ds3Request), is(expected));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParseResponsePayload_NoPayload_Test.
@Test
public void toParseResponsePayload_NoPayload_Test() {
final Ds3Request request = createDs3RequestTestData("com.test.Request", Classification.amazons3);
assertThat(generator.toParseResponsePayload(request), is(""));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParseResponsePayload_NoNameToMarshal_Test.
@Test
public void toParseResponsePayload_NoNameToMarshal_Test() {
final String expected = "if self.response.status == 200:\n" + " self.result = parseModel(xmldom.fromstring(response.read()), ListBucketResult())";
final Ds3Request request = getBucketRequest();
assertThat(generator.toParseResponsePayload(request), is(expected));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParseResponsePayload_WithNameToMarshal_Test.
@Test
public void toParseResponsePayload_WithNameToMarshal_Test() {
final String expected = "if self.response.status == 200:\n" + " self.result = parseModel(xmldom.fromstring(response.read()), JobWithChunksApiBean())";
final Ds3Request request = getRequestGetJob();
assertThat(generator.toParseResponsePayload(request), is(expected));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class HeadResponseGenerator_Test method getStatusCodes_HeadObject_Test.
@Test
public void getStatusCodes_HeadObject_Test() {
final Ds3Request headObject = getHeadObjectRequest();
final ImmutableList<Integer> result = generator.getStatusCodes(headObject.getDs3ResponseCodes(), headObject.getName());
assertThat(result.size(), is(3));
assertThat(result, hasItem(200));
assertThat(result, hasItem(403));
assertThat(result, hasItem(404));
}
Aggregations