use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toConstructorList_Test.
@Test
public void toConstructorList_Test() {
final ImmutableList<Ds3Param> params = createTestDs3ParamList();
final Ds3Request request = createDs3RequestTestData(true, null, params);
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(3));
assertThat(constructorParams.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorParams.get(1).getName(), is("Name"));
assertThat(constructorParams.get(2).getName(), is("Priority"));
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.Arguments in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method splitUuidConstructor_Test.
@Test
public void splitUuidConstructor_Test() {
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("String", "StringArg"), new Arguments("UUID", "UuidArg"), new Arguments("int", "IntArg"));
final RequestConstructor constructor = new RequestConstructor(args, args, argsToQueryParams(args), "");
final ImmutableList<RequestConstructor> result = splitUuidConstructor(constructor);
assertThat(result.size(), is(2));
assertThat(getAllArgumentTypes(result.get(0).getParameters()), hasItem("UUID"));
assertThat(getQueryParamTypes(result.get(0).getQueryParams()), hasItem("UUID"));
assertThat(getAllArgumentTypes(result.get(0).getAssignments()), hasItem("UUID"));
assertThat(getAllArgumentTypes(result.get(1).getParameters()), not(hasItem("UUID")));
assertThat(getQueryParamTypes(result.get(1).getQueryParams()), not(hasItem("UUID")));
assertThat(getAllArgumentTypes(result.get(1).getAssignments()), not(hasItem("UUID")));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method splitUuidOptionalArgument_UUID_Test.
@Test
public void splitUuidOptionalArgument_UUID_Test() {
final ImmutableList<Arguments> result = splitUuidOptionalArgument(new Arguments("UUID", "Arg"));
assertThat(result.size(), is(2));
assertThat(result.get(0).getType(), is("UUID"));
assertThat(result.get(1).getType(), is("String"));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method convertUuidConstructorToStringConstructor_Test.
@Test
public void convertUuidConstructorToStringConstructor_Test() {
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("String", "StringArg"), new Arguments("UUID", "UuidArg"), new Arguments("int", "IntArg"));
final RequestConstructor constructor = new RequestConstructor(args, args, argsToQueryParams(args), "");
final RequestConstructor result = convertUuidConstructorToStringConstructor(constructor);
assertThat(getAllArgumentTypes(result.getParameters()), not(hasItem("UUID")));
assertThat(getQueryParamTypes(result.getQueryParams()), not(hasItem("UUID")));
assertThat(getAllArgumentTypes(result.getAssignments()), not(hasItem("UUID")));
}
use of com.spectralogic.ds3autogen.api.models.Arguments 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>"));
}
Aggregations