use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method getRequestPath_SpectraS3ResourceWithJobChunkId_Test.
@Test
public void getRequestPath_SpectraS3ResourceWithJobChunkId_Test() {
final String expectedPath = "\"/_rest_/job_chunk/\" + jobChunkId";
final Ds3Request request = createDs3RequestTestData("RequestName", Classification.spectrads3, Resource.JOB_CHUNK, ResourceType.NON_SINGLETON, true);
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 BaseRequestGenerator_Test method getRequestPath_SpectraS3_Test.
@Test
public void getRequestPath_SpectraS3_Test() {
final String expectedPath = "\"/_rest_/\"";
final Ds3Request request = createDs3RequestTestData("RequestName", Classification.spectrads3);
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 BulkRequestGenerator_Test method toConstructorArgumentsList_Test.
@Test
public void toConstructorArgumentsList_Test() {
final Ds3Request request = createSimpleTestDs3Request();
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("Priority"));
assertThat(result.get(4).getName(), is("NotificationEndPoint"));
assertThat(result.get(5).getName(), is("Objects"));
assertThat(result.get(5).getType(), is("Iterable<Ds3Object>"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class CreateNotificationRequestGenerator_Test method toConstructorList_Test.
@Test
public void toConstructorList_Test() {
final ImmutableList.Builder<Ds3Param> builder = ImmutableList.builder();
builder.addAll(createTestDs3ParamList());
builder.add(new Ds3Param("NotificationEndPoint", "String", false));
final Ds3Request request = createDs3RequestTestData(true, null, builder.build());
final ImmutableList<RequestConstructor> result = generator.toConstructorList(request, "", new Ds3DocSpecEmptyImpl());
assertThat(result.size(), is(1));
final RequestConstructor constructor = result.get(0);
assertThat(constructor.getAdditionalLines().size(), is(0));
assertThat(constructor.isDeprecated(), is(false));
final ImmutableList<Arguments> constructorParams = constructor.getParameters();
assertThat(constructorParams.size(), is(4));
assertThat(constructorParams.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorParams.get(1).getName(), is("Name"));
assertThat(constructorParams.get(2).getName(), is("Priority"));
assertThat(constructorParams.get(3).getName(), is("NotificationEndPoint"));
final ImmutableList<Arguments> constructorAssignments = constructor.getAssignments();
assertThat(constructorAssignments.size(), is(3));
assertThat(constructorAssignments.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorAssignments.get(1).getName(), is("Name"));
assertThat(constructorAssignments.get(2).getName(), is("Priority"));
final ImmutableList<QueryParam> queryParams = constructor.getQueryParams();
assertThat(queryParams.size(), is(4));
assertThat(queryParams.get(0).getName(), is("IgnoreNamingConflicts"));
assertThat(queryParams.get(1).getName(), is("MaxUploadSize"));
assertThat(queryParams.get(2).getName(), is("Name"));
assertThat(queryParams.get(3).getName(), is("Priority"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class CreateNotificationRequestGenerator_Test method toQueryParamsList_Test.
@Test
public void toQueryParamsList_Test() {
final Ds3Request request = createSimpleTestDs3Request();
final ImmutableList<QueryParam> result = generator.toQueryParamsList(request);
assertThat(result.size(), is(1));
assertThat(result.get(0).getName(), is("Priority"));
}
Aggregations