Package org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode


        args.mapPut("childEntity.value", firstChildRepr);
        RestfulResponse<JsonRepresentation> invokeResp = client.follow(invokeLinkRepr, args);
       
        @SuppressWarnings("unused")
        JsonRepresentation invokeRepr = invokeResp.getEntity();
        final HttpStatusCode status = invokeResp.getStatus();
        assertThat(status, is(HttpStatusCode.OK));

        // then
        childrenRestfulResponse =
                RestfulResponse.ofT(objectResource.accessCollection("PRNT", "53", "children"));
View Full Code Here


    @Test
    public void simpleNoMessage() throws Exception {

        // given
        final HttpStatusCode status = HttpStatusCode.BAD_REQUEST;
        final RestfulObjectsApplicationException ex = RestfulObjectsApplicationException.create(status);

        // when
        final Response response = exceptionMapper.toResponse(ex);
View Full Code Here

        assertThat(HttpStatusCode.statusFor(200), is(HttpStatusCode.OK));
    }

    @Test
    public void unknownStatusCode() {
        final HttpStatusCode statusFor = HttpStatusCode.statusFor(600);
        assertThat(statusFor.getStatusCode(), is(600));
        assertThat(statusFor.getFamily(), is(Family.OTHER));
    }
View Full Code Here

@Provider
public class RuntimeExceptionMapper implements ExceptionMapper<RuntimeException> {

    @Override
    public Response toResponse(final RuntimeException ex) {
        HttpStatusCode statusCode = HttpStatusCode.INTERNAL_SERVER_ERROR;
        if(ex instanceof Failure) {
            Failure failure = (Failure) ex;
            statusCode = HttpStatusCode.statusFor(failure.getErrorCode());
        }
        final ResponseBuilder builder = Response.status(statusCode.getJaxrsStatusType()).type(RestfulMediaType.APPLICATION_JSON_ERROR).entity(jsonFor(ex));
        return builder.build();
    }
View Full Code Here

    @Test
    public void simpleNoMessage() throws Exception {

        // given
        final HttpStatusCode status = HttpStatusCode.BAD_REQUEST;
        final RestfulObjectsApplicationException ex = RestfulObjectsApplicationException.create(status);

        // when
        final Response response = exceptionMapper.toResponse(ex);
View Full Code Here

        args.mapPut("childEntity.value", firstChildRepr);
        RestfulResponse<JsonRepresentation> invokeResp = client.follow(invokeLinkRepr, args);
       
        @SuppressWarnings("unused")
        JsonRepresentation invokeRepr = invokeResp.getEntity();
        final HttpStatusCode status = invokeResp.getStatus();
        assertThat(status, is(HttpStatusCode.OK));

        // then
        childrenRestfulResponse =
                RestfulResponse.ofT(objectResource.accessCollection("PRNT", "43", "children"));
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.