use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseCode in project ds3_autogen by SpectraLogic.
the class ResponseAndParserUtil_Test method getImportFromResponseCode_Test.
@Test
public void getImportFromResponseCode_Test() {
final Ds3ResponseCode responseCode = createPopulatedResponseCode("");
final String result = getImportFromResponseCode(responseCode);
assertThat(result, is("com.spectralogic.ds3client.models.Type"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseCode in project ds3_autogen by SpectraLogic.
the class ResponseAndParserUtil_Test method getImportFromResponseCode_NullReturnType_Test.
@Test
public void getImportFromResponseCode_NullReturnType_Test() {
final Ds3ResponseCode responseCode = createPopulatedNullResponseCode();
final String result = getImportFromResponseCode(responseCode);
assertThat(result, is(""));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseCode in project ds3_autogen by SpectraLogic.
the class ResponseAndParserUtil_Test method getImportFromResponseCode_ErrorComponentType_Test.
@Test(expected = IllegalArgumentException.class)
public void getImportFromResponseCode_ErrorComponentType_Test() {
final Ds3ResponseCode responseCode = new Ds3ResponseCode(400, ImmutableList.of(new Ds3ResponseType("array", "com.spectralogic.Test.Type")));
getImportFromResponseCode(responseCode);
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseCode in project ds3_autogen by SpectraLogic.
the class ResponsePayloadUtil_Test method removeNullPayloads_FullList_Test.
@Test
public void removeNullPayloads_FullList_Test() {
final ImmutableList<Ds3ResponseCode> codes = ImmutableList.of(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("null", null))), new Ds3ResponseCode(207, ImmutableList.of(new Ds3ResponseType("com.test.ResponsePayload", null))));
final ImmutableList<Ds3ResponseCode> result = removeNullPayloads(codes);
assertThat(result.size(), is(1));
assertThat(result.get(0).getCode(), is(207));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ResponseCode 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));
}
Aggregations