use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType in project ds3_autogen by SpectraLogic.
the class ResponsePayloadUtil_Test method getAllNonErrorResponseCodes_FullList_Test.
@Test
public void getAllNonErrorResponseCodes_FullList_Test() {
final ImmutableList<Ds3ResponseCode> codes = ImmutableList.of(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("com.test.ResponseType", null))), new Ds3ResponseCode(204, ImmutableList.of(new Ds3ResponseType("com.test.ResponseType", null))), new Ds3ResponseCode(400, ImmutableList.of(new Ds3ResponseType("com.test.ResponseType", null))));
final ImmutableList<Integer> result = getAllNonErrorResponseCodes(codes);
assertThat(result.size(), is(2));
assertThat(result, hasItem(200));
assertThat(result, hasItem(204));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType in project ds3_autogen by SpectraLogic.
the class ResponsePayloadUtil_Test method getResponsePayload_NoResponsePayload_Test.
@Test
public void getResponsePayload_NoResponsePayload_Test() {
final ImmutableList<Ds3ResponseCode> codes = ImmutableList.of(new Ds3ResponseCode(204, ImmutableList.of(new Ds3ResponseType("null", null))));
assertThat(getResponsePayload(codes), is(nullValue()));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType in project ds3_autogen by SpectraLogic.
the class ResponsePayloadUtil_Test method getResponsePayload_Exception_Test.
@Test(expected = IllegalArgumentException.class)
public void getResponsePayload_Exception_Test() {
final ImmutableList<Ds3ResponseCode> codes = ImmutableList.of(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("ResponseType", null))), new Ds3ResponseCode(204, ImmutableList.of(new Ds3ResponseType("ResponseType2", null))));
getResponsePayload(codes);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType in project ds3_autogen by SpectraLogic.
the class BaseResponseParserGenerator_Test method getResponseCode_Test.
@Test
public void getResponseCode_Test() {
final ImmutableList<Ds3ResponseCode> codes = ImmutableList.of(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("com.test.ResponsePayload", null))), new Ds3ResponseCode(400, ImmutableList.of(new Ds3ResponseType("com.test.ErrorPayload", null))));
final Integer result = getResponseCode(codes);
assertThat(result, is(200));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseType in project ds3_autogen by SpectraLogic.
the class ResponseAndParserUtil_Test method getResponseModelName_ComponentType_Test.
@Test
public void getResponseModelName_ComponentType_Test() {
final Ds3ResponseType responseType = new Ds3ResponseType("array", "com.test.ComponentType");
assertThat(getResponseModelName(responseType), is("List<ComponentType>"));
}
Aggregations