use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method convertGuidToStringList_FullList_Test.
@Test
public void convertGuidToStringList_FullList_Test() {
final ImmutableList<NetNullableVariable> vars = ImmutableList.of(new NetNullableVariable("GuidVar", "Guid", true, true), new NetNullableVariable("IntVar", "int", true, true));
final ImmutableList<NetNullableVariable> result = convertGuidToStringList(vars);
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("GuidVar"));
assertThat(result.get(0).getType(), is("string"));
assertThat(result.get(1).getName(), is("IntVar"));
assertThat(result.get(1).getType(), is("int"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable 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?"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable 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"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElement_EnumElement_Test.
@Test
public void toElement_EnumElement_Test() {
final Ds3Element ds3Element = new Ds3Element("TestElement", "java.lang.Integer", null, ImmutableList.of(new Ds3Annotation("com.spectralogic.util.bean.lang.Optional", null)), true);
final NetNullableVariable result = generator.toElement(ds3Element, ImmutableMap.of());
assertThat(result.getName(), is("TestElement"));
assertThat(result.getNetType(), is("int?"));
}
Aggregations