use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method getSpectraDs3RequestPath_Test.
@Test
public void getSpectraDs3RequestPath_Test() {
final Ds3Request deleteNotification = getRequestDeleteNotification();
assertThat(getSpectraDs3RequestPath(deleteNotification), is("\"/_rest_/job_created_notification_registration/\" + this.getNotificationId().toString()"));
final Ds3Request createNotification = getRequestCreateNotification();
assertThat(getSpectraDs3RequestPath(createNotification), is("\"/_rest_/job_created_notification_registration\""));
final Ds3Request getNotification = getRequestGetNotification();
assertThat(getSpectraDs3RequestPath(getNotification), is("\"/_rest_/job_completed_notification_registration/\" + this.getNotificationId().toString()"));
final Ds3Request verifyPhysicalPlacement = getRequestVerifyPhysicalPlacement();
assertThat(getSpectraDs3RequestPath(verifyPhysicalPlacement), is("\"/_rest_/bucket/\" + this.bucketName"));
final Ds3Request bulkRequest = getRequestBulkGet();
assertThat(getSpectraDs3RequestPath(bulkRequest), is("\"/_rest_/bucket/\" + this.bucketName"));
final Ds3Request spectraS3GetObject = getRequestSpectraS3GetObject();
assertThat(getSpectraDs3RequestPath(spectraS3GetObject), is("\"/_rest_/object/\" + objectName"));
//Non-Spectra Request
final Ds3Request multiFileDelete = getRequestMultiFileDelete();
assertThat(getSpectraDs3RequestPath(multiFileDelete), is(""));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toConstructorArgumentsList_Test.
@Test
public void toConstructorArgumentsList_Test() {
final ImmutableList<Ds3Param> params = createTestDs3ParamList();
final Ds3Request request = new Ds3Request("RequestName", HttpVerb.DELETE, Classification.spectrads3, Requirement.REQUIRED, Requirement.REQUIRED, Action.BULK_DELETE, Resource.JOB, ResourceType.NON_SINGLETON, Operation.START_BULK_GET, true, null, null, params);
final ImmutableList<Arguments> result = generator.toConstructorArgumentsList(request);
assertThat(result.size(), is(6));
assertThat(result.get(0).getName(), is("BucketName"));
assertThat(result.get(1).getName(), is("ObjectName"));
assertThat(result.get(2).getName(), is("JobId"));
assertThat(result.get(3).getName(), is("MaxUploadSize"));
assertThat(result.get(4).getName(), is("Name"));
assertThat(result.get(5).getName(), is("Priority"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method getRequestPath_SpectraS3ResourceWithJobChunkId_NotInclude_Test.
@Test
public void getRequestPath_SpectraS3ResourceWithJobChunkId_NotInclude_Test() {
final String expectedPath = "\"/_rest_/job_chunk\"";
final Ds3Request request = createDs3RequestTestData("RequestName", Classification.spectrads3, Resource.JOB_CHUNK, ResourceType.NON_SINGLETON, false);
final String requestPath = getRequestPath(request);
assertThat(requestPath, is(expectedPath));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class NotificationRequestGenerator_Test method getParentImport_Delete_Test.
@Test
public void getParentImport_Delete_Test() {
final Ds3Request request = getRequestDeleteNotification();
final String result = generator.getParentImport(request);
assertThat(result, is("com.spectralogic.ds3client.commands.interfaces.AbstractDeleteNotificationRequest"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class NotificationRequestGenerator_Test method getAllImports_Exception_Test.
@Test(expected = IllegalArgumentException.class)
public void getAllImports_Exception_Test() {
final Ds3Request request = createSimpleTestDs3Request();
generator.getAllImports(request, "com.spectralogic.ds3client.commands.spectrads3.notifications");
}
Aggregations