use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class RequestConverterUtil_Test method getNonVoidArgsFromParamList_FullList_Test.
@Test
public void getNonVoidArgsFromParamList_FullList_Test() {
final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("SimpleArg", "SimpleType", false), new Ds3Param("VoidArg", "void", false));
final ImmutableList<Arguments> result = getNonVoidArgsFromParamList(params);
assertThat(result.size(), is(1));
assertThat(result.get(0).getType(), is(not("void")));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class Ds3RequestClassificationUtil_Test method paramListContainsParam_test.
@Test
public void paramListContainsParam_test() {
final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("Name1", "Type1", false), new Ds3Param("Name2", "Type2", false));
assertTrue(paramListContainsParam(params, "Name1", "Type1"));
assertTrue(paramListContainsParam(params, "Name2", "Type2"));
assertFalse(paramListContainsParam(params, "Name1", "Type2"));
assertFalse(paramListContainsParam(params, "Name2", "Type1"));
assertFalse(paramListContainsParam(null, "Name1", "Type1"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toQueryParamsList_Test.
@Test
public void toQueryParamsList_Test() {
final ImmutableList<Ds3Param> params = createTestDs3ParamList();
final Ds3Request request = createDs3RequestTestData(true, null, params);
final ImmutableList<QueryParam> result = generator.toQueryParamsList(request);
assertThat(result.size(), is(4));
assertThat(result.get(0).getName(), is("IgnoreNamingConflicts"));
assertThat(result.get(1).getName(), is("MaxUploadSize"));
assertThat(result.get(2).getName(), is("Name"));
assertThat(result.get(3).getName(), is("Priority"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toRequiredArgumentsList_Test.
@Test
public void toRequiredArgumentsList_Test() {
final ImmutableList<Ds3Param> params = createTestDs3ParamList();
final Ds3Request request = createDs3RequestTestData(true, null, params);
final ImmutableList<Arguments> result = generator.toRequiredArgumentsList(request);
assertThat(result.size(), is(4));
assertThat(result.get(0).getName(), is("IgnoreNamingConflicts"));
assertThat(result.get(1).getName(), is("MaxUploadSize"));
assertThat(result.get(2).getName(), is("Name"));
assertThat(result.get(3).getName(), is("Priority"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class BulkRequestGenerator_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(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("Objects"));
final ImmutableList<Arguments> constructorAssignments = constructor.getAssignments();
assertThat(constructorAssignments.size(), is(2));
assertThat(constructorAssignments.get(0).getName(), is("MaxUploadSize"));
assertThat(constructorAssignments.get(1).getName(), is("Name"));
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"));
}
Aggregations