use of com.spectralogic.ds3autogen.go.models.response.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toStringPayloadResponseCode.
@Test
public void toStringPayloadResponseCode() {
final String expect = "content, err := getResponseBodyAsString(webResponse)\n" + " if err != nil {\n" + " return nil, err\n" + " }\n" + " return &ResponseName{Content: content}, nil";
final ResponseCode result = generator.toStringPayloadResponseCode(200, "ResponseName");
assertThat(result.getCode(), is(200));
assertThat(result.getParseResponse(), is(expect));
}
use of com.spectralogic.ds3autogen.go.models.response.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toResponseCode_NullPayload_Test.
@Test
public void toResponseCode_NullPayload_Test() {
final String expectedGoCode = "return &ResponseName{}, nil";
final Ds3ResponseCode responseCode = new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("null", "")));
final ResponseCode result = generator.toResponseCode(responseCode, "ResponseName");
assertThat(result.getCode(), is(200));
assertThat(result.getParseResponse(), is(expectedGoCode));
}
use of com.spectralogic.ds3autogen.go.models.response.ResponseCode in project ds3_autogen by SpectraLogic.
the class GetObjectResponseGenerator_Test method toResponseCode_206_Test.
@Test
public void toResponseCode_206_Test() {
final ResponseCode expected = new ResponseCode(206, "return &GetObjectResponse{}, nil");
final Ds3ResponseCode code = new Ds3ResponseCode(206, ImmutableList.of(new Ds3ResponseType("null", null)));
final ResponseCode result = generator.toResponseCode(code, "GetObjectResponse");
assertThat(result, is(expected));
}
use of com.spectralogic.ds3autogen.go.models.response.ResponseCode in project ds3_autogen by SpectraLogic.
the class BaseResponseGenerator_Test method toNullPayloadResponseCode_Test.
@Test
public void toNullPayloadResponseCode_Test() {
final String expectedGoCode = "return &ResponseName{}, nil";
final ResponseCode result = generator.toNullPayloadResponseCode(200, "ResponseName");
assertThat(result.getCode(), is(200));
assertThat(result.getParseResponse(), is(expectedGoCode));
}
Aggregations