use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class NotificationRequestGenerator_Test method getAllImports_Get_Test.
@Test
public void getAllImports_Get_Test() {
final Ds3Request request = getRequestGetNotification();
final ImmutableList<String> result = generator.getAllImports(request, "com.spectralogic.ds3client.commands.spectrads3.notifications");
assertThat(result.size(), is(2));
assertTrue(result.contains("com.spectralogic.ds3client.commands.interfaces.AbstractGetNotificationRequest"));
assertTrue(result.contains("java.util.UUID"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class NotificationRequestGenerator_Test method getParentImport_Exception_Test.
@Test(expected = IllegalArgumentException.class)
public void getParentImport_Exception_Test() {
final Ds3Request request = createSimpleTestDs3Request();
generator.getParentImport(request);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class ObjectsPayloadGenerator_Test method getAdditionalContent_RequiredPartList_Test.
@Test
public void getAdditionalContent_RequiredPartList_Test() {
final String expected = "if part_list is not None:\n" + " if not isinstance(part_list, PartList):\n" + " raise TypeError('com.spectralogic.s3.server.handler.reqhandler.amazons3.CompleteMultiPartUploadRequestHandler should have request payload of type: PartList')\n" + " self.body = xmldom.tostring(part_list.to_xml())\n";
final Ds3Request request = getCompleteMultipartUploadRequest();
final String result = generator.getAdditionalContent(request, request.getName());
assertThat(result, is(expected));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class ObjectsPayloadGenerator_Test method getAdditionalContent_RequiredDeleteObjectList_Test.
@Test
public void getAdditionalContent_RequiredDeleteObjectList_Test() {
final String expected = "if object_list is not None:\n" + " if not isinstance(object_list, DeleteObjectList):\n" + " raise TypeError('com.spectralogic.s3.server.handler.reqhandler.amazons3.DeleteObjectsRequestHandler should have request payload of type: DeleteObjectList')\n" + " self.body = xmldom.tostring(object_list.to_xml())\n";
final Ds3Request request = getRequestMultiFileDelete();
final String result = generator.getAdditionalContent(request, request.getName());
assertThat(result, is(expected));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class PutObjectRequestGenerator method toRequiredConstructorParams.
/**
* Gets the sorted list of required constructor params, including stream and length
*/
@Override
public ImmutableList<ConstructorParam> toRequiredConstructorParams(final Ds3Request ds3Request) {
final ImmutableList.Builder<Arguments> builder = ImmutableList.builder();
builder.addAll(getNonVoidArgsFromParamList(ds3Request.getRequiredQueryParams()));
builder.addAll(getAssignmentArguments(ds3Request));
builder.add(new Arguments("", "stream"));
builder.add(new Arguments("", "length"));
return builder.build().stream().sorted(new CustomArgumentComparator()).map(arg -> new ConstructorParam(camelToUnderscore(arg.getName()), false)).collect(GuavaCollectors.immutableList());
}
Aggregations