use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method updateDs3RequestParamTypes_Test.
@Test
public void updateDs3RequestParamTypes_Test() {
final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("Arg1", "String", false), new Ds3Param("Arg2", "java.util.UUID", false), new Ds3Param("BucketId", "java.util.UUID", false));
final Ds3Request request = createDs3RequestTestData(false, params, params);
final Ds3Request result = updateDs3RequestParamTypes(request);
final ImmutableList<Ds3Param> requiredParams = result.getRequiredQueryParams();
assertThat(requiredParams.size(), is(3));
assertThat(requiredParams.get(0).getName(), is("Arg1"));
assertThat(requiredParams.get(0).getType(), is("String"));
assertThat(requiredParams.get(1).getName(), is("Arg2"));
assertThat(requiredParams.get(1).getType(), is("java.util.UUID"));
assertThat(requiredParams.get(2).getName(), is("BucketId"));
assertThat(requiredParams.get(2).getType(), is("String"));
final ImmutableList<Ds3Param> optionalParams = result.getOptionalQueryParams();
assertThat(optionalParams.size(), is(3));
assertThat(optionalParams.get(0).getName(), is("Arg1"));
assertThat(optionalParams.get(0).getType(), is("String"));
assertThat(optionalParams.get(1).getName(), is("Arg2"));
assertThat(optionalParams.get(1).getType(), is("java.util.UUID"));
assertThat(optionalParams.get(2).getName(), is("BucketId"));
assertThat(optionalParams.get(2).getType(), is("String"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.
the class RequestConverterUtil_Test method getVoidArgsFromParamList_FullList_Test.
@Test
public void getVoidArgsFromParamList_FullList_Test() {
final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("SimpleArg", "SimpleType", false), new Ds3Param("VoidArg", "void", false));
final ImmutableList<Arguments> result = getVoidArgsFromParamList(params);
assertThat(result.size(), is(1));
assertThat(result.get(0).getType(), is("void"));
}
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 toOptionalArgumentsList_FullList_Test.
@Test
public void toOptionalArgumentsList_FullList_Test() {
final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("SimpleArg", "SimpleType", false), new Ds3Param("ArgWithPath", "com.test.TypeWithPath", false));
final ImmutableList<NetNullableVariable> result = generator.toOptionalArgumentsList(params, ImmutableMap.of());
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("SimpleArg"));
assertThat(result.get(0).getNetType(), is("SimpleType"));
assertThat(result.get(1).getName(), is("ArgWithPath"));
assertThat(result.get(1).getNetType(), is("TypeWithPath"));
}
Aggregations