use of com.spectralogic.ds3autogen.java.models.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseParserGenerator_Test method toResponseCode_BaseResponse_Test.
@Test
public void toResponseCode_BaseResponse_Test() {
final String expected = "try (final InputStream inputStream = response.getResponseStream()) {\n" + " final Type result = XmlOutput.fromXml(inputStream, Type.class);\n" + " return new TestResponse(result, this.getChecksum(), this.getChecksumType());\n" + " }\n";
final ResponseCode result = toResponseCode(getBaseResponseCode(), "TestResponse", true, false);
assertThat(result.getCode(), is(202));
assertThat(result.getProcessingCode(), is(expected));
}
use of com.spectralogic.ds3autogen.java.models.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseParserGenerator_Test method toResponseCode_StringResponse_Test.
@Test
public void toResponseCode_StringResponse_Test() {
final String expected = "try (final InputStream inputStream = response.getResponseStream()) {\n" + " final String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8);\n" + " return new TestResponse(result, this.getChecksum(), this.getChecksumType());\n" + " }\n";
final ResponseCode result = toResponseCode(getStringResponseCode(), "TestResponse", true, false);
assertThat(result.getCode(), is(201));
assertThat(result.getProcessingCode(), is(expected));
}
use of com.spectralogic.ds3autogen.java.models.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseParserGenerator_Test method toStatusCodeList_FullList_Test.
@Test
public void toStatusCodeList_FullList_Test() {
final ImmutableList<ResponseCode> responseCodes = ImmutableList.of(new ResponseCode(201, ""), new ResponseCode(202, ""), new ResponseCode(203, ""));
final String result = toStatusCodeList(responseCodes);
assertThat(result, is("201, 202, 203"));
}
use of com.spectralogic.ds3autogen.java.models.ResponseCode in project ds3_autogen by SpectraLogic.
the class GetJobChunksReadyParserGenerator_Test method toResponseCodeList_Test.
@Test
public void toResponseCodeList_Test() {
final Ds3Request ds3Request = getJobChunksReadyForClientProcessingRequest();
final ImmutableList<ResponseCode> result = generator.toResponseCodeList(ds3Request.getDs3ResponseCodes(), "TestResponse", false);
assertThat(result.size(), is(1));
assertThat(result.get(0).getCode(), is(200));
}
Aggregations