use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class MultiFileDeleteRequestGenerator_Test method createObjectsConstructor_Test.
@Test
public void createObjectsConstructor_Test() {
final RequestConstructor result = createObjectsConstructor(ImmutableList.of(new Arguments("Type", "Arg1")), ImmutableList.of(new QueryParam("Type", "Arg2")), "", new Ds3DocSpecEmptyImpl());
assertThat(result.isDeprecated(), is(false));
assertThat(result.getAdditionalLines().size(), is(0));
final ImmutableList<Arguments> params = result.getParameters();
assertThat(params.size(), is(2));
assertThat(params.get(0).getName(), is("Arg1"));
assertThat(params.get(1).getName(), is("Objects"));
final ImmutableList<Arguments> assignments = result.getAssignments();
assertThat(assignments.size(), is(2));
assertThat(assignments.get(0).getName(), is("Arg1"));
assertThat(assignments.get(1).getName(), is("Objects"));
final ImmutableList<QueryParam> queryParams = result.getQueryParams();
assertThat(queryParams.size(), is(1));
assertThat(queryParams.get(0).getName(), is("Arg2"));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toWithConstructor_Boolean_Test.
@Test
public void toWithConstructor_Boolean_Test() {
final String expectedResultBoolean = " public RequestName withArgName(final boolean argName) {\n" + " this.argName = argName;\n" + " this.updateQueryParam(\"arg_name\", argName);\n" + " return this;\n" + " }\n";
final Arguments booleanArgument = new Arguments("boolean", "ArgName");
final String booleanResult = generator.toWithConstructor(booleanArgument, "RequestName", new Ds3DocSpecEmptyImpl());
assertThat(booleanResult, is(expectedResultBoolean));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BulkRequestGenerator_Test method toConstructorAssignmentList_FullList_Test.
@Test
public void toConstructorAssignmentList_FullList_Test() {
final ImmutableList<Arguments> arguments = ImmutableList.of(new Arguments("type", "Priority"), new Arguments("type", "Name1"), new Arguments("type", "WriteOptimization"), new Arguments("type", "BucketName"), new Arguments("type", "Name2"), new Arguments("type", "Objects"));
final ImmutableList<Arguments> result = toConstructorAssignmentList(arguments);
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("Name1"));
assertThat(result.get(1).getName(), is("Name2"));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BulkRequestGenerator_Test method toWithConstructor_Test.
@Test
public void toWithConstructor_Test() {
final String expectedResult = " public GetBucketRequestHandler withDelimiter(final String delimiter) {\n" + " this.delimiter = delimiter;\n" + " this.updateQueryParam(\"delimiter\", delimiter);\n" + " return this;\n" + " }\n";
final Arguments arg = new Arguments("String", "Delimiter");
final String result = generator.toWithConstructor(arg, "GetBucketRequestHandler", new Ds3DocSpecEmptyImpl());
assertThat(result, is(expectedResult));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParam_SimpleType_Test.
@Test
public void toParam_SimpleType_Test() {
final Ds3ResponseCode responseCode = new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("com.test.TestType", null)));
final Optional<Arguments> result = toParam(responseCode);
assertTrue(result.isPresent());
assertThat(result.get().getName(), is("testTypeResult"));
assertThat(result.get().getType(), is("TestType"));
}
Aggregations