Search in sources :

Example 36 with Ds3Param

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.

the class BulkPutRequestGenerator_Test method toOptionalArgumentsList_FullList_Test.

@Test
public void toOptionalArgumentsList_FullList_Test() {
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("MaxUploadSize", "long", false), new Ds3Param("MaxUploads", "int", false), new Ds3Param("Prefix", "java.lang.String", true));
    final ImmutableList<NetNullableVariable> result = generator.toOptionalArgumentsList(params, ImmutableMap.of());
    assertThat(result.size(), is(2));
    assertThat(result.get(0).getName(), is("MaxUploads"));
    assertThat(result.get(1).getName(), is("Prefix"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 37 with Ds3Param

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.

the class GetObjectRequestGenerator_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(0));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 38 with Ds3Param

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toNullableArgument_NonNullablePrimitive_Test.

@Test
public void toNullableArgument_NonNullablePrimitive_Test() {
    //Note: optional parameters are always nullable
    final Ds3Param param = new Ds3Param("MyParam", "java.lang.Integer", false);
    final NetNullableVariable result = toNullableArgument(param, ImmutableMap.of());
    assertThat(result.getNetType(), is("int?"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 39 with Ds3Param

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Param in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toNullableArgument_NullableSpectraType_Test.

@Test
public void toNullableArgument_NullableSpectraType_Test() {
    final Ds3Param param = new Ds3Param("MyParam", "com.spectra.TestType", true);
    final NetNullableVariable result = toNullableArgument(param, ImmutableMap.of());
    assertThat(result.getNetType(), is("TestType"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Aggregations

Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)39 Test (org.junit.Test)37 Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)10 Arguments (com.spectralogic.ds3autogen.api.models.Arguments)8 RequestGeneratorTestHelper.createSimpleTestDs3Request (com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request)8 NetNullableVariable (com.spectralogic.ds3autogen.net.model.common.NetNullableVariable)8 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)5 QueryParam (com.spectralogic.ds3autogen.java.models.QueryParam)5 Ds3ModelPartialDataFixture.createEmptyDs3Request (com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request)5 ImmutableList (com.google.common.collect.ImmutableList)3 Parameter (com.spectralogic.ds3autogen.c.models.Parameter)3 SimpleVariable (com.spectralogic.ds3autogen.go.models.request.SimpleVariable)3 WithConstructor (com.spectralogic.ds3autogen.go.models.request.WithConstructor)3 RequestConstructor (com.spectralogic.ds3autogen.java.models.RequestConstructor)3 Request (com.spectralogic.ds3autogen.c.models.Request)2 Variable (com.spectralogic.ds3autogen.go.models.request.Variable)2 TestFileUtilsImpl (com.spectralogic.ds3autogen.utils.TestFileUtilsImpl)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 HashMap (java.util.HashMap)2 Ds3Type (com.spectralogic.ds3autogen.api.models.apispec.Ds3Type)1