use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParamList_FullList_Test.
@Test
public void toParamList_FullList_Test() {
final ImmutableList<Ds3ResponseCode> responseCodes = ImmutableList.of(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("com.test.TestTypeB", null))), new Ds3ResponseCode(201, ImmutableList.of(new Ds3ResponseType("null", null))), new Ds3ResponseCode(203, ImmutableList.of(new Ds3ResponseType("com.test.TestTypeA", null))), new Ds3ResponseCode(400, ImmutableList.of(new Ds3ResponseType("com.test.TestTypeC", null))));
final ImmutableList<Arguments> result = generator.toParamList(responseCodes);
assertThat(result.size(), is(2));
assertThat(result.get(0).getName(), is("testTypeAResult"));
assertThat(result.get(1).getName(), is("testTypeBResult"));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParam_NullPayload_Test.
@Test
public void toParam_NullPayload_Test() {
final Ds3ResponseCode responseCode = new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("null", null)));
final Optional<Arguments> result = toParam(responseCode);
assertFalse(result.isPresent());
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toConstructorParams_FullList_Test.
@Test
public void toConstructorParams_FullList_Test() {
final String expected = "final TypeOne argOne, final TypeTwo argTwo, final TypeThree argThree";
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("TypeOne", "ArgOne"), new Arguments("TypeTwo", "ArgTwo"), new Arguments("TypeThree", "ArgThree"));
final String result = generator.toConstructorParams(args);
assertThat(result, is(expected));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toParam_ComponentType_Test.
@Test
public void toParam_ComponentType_Test() {
final Ds3ResponseCode responseCode = new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("array", "com.test.ComponentType")));
final Optional<Arguments> result = toParam(responseCode);
assertTrue(result.isPresent());
assertThat(result.get().getName(), is("componentTypeListResult"));
assertThat(result.get().getType(), is("List<ComponentType>"));
}
use of com.spectralogic.ds3autogen.api.models.Arguments in project ds3_autogen by SpectraLogic.
the class GetObjectResponseGenerator_Test method toConstructorParamsWithChecksum_FullList_Test.
@Test
public void toConstructorParamsWithChecksum_FullList_Test() {
final String expected = "final Metadata metadata, final long objectSize, final String checksum, final ChecksumType.Type checksumType";
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("Metadata", "Metadata"), new Arguments("long", "ObjectSize"));
assertThat(generator.toConstructorParamsWithChecksum(args), is(expected));
}
Aggregations