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

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.withHeader()


    public void runtimeException_isMapped() throws Exception {

        // given
        final RestfulRequest restfulReq = client.createRequest(RestfulHttpMethod.GET, "version");
        final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean());
        restfulReq.withHeader(header, true);

        // when
        final RestfulResponse<JsonRepresentation> jsonResp = restfulReq.execute();

        // then
View Full Code Here


    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "version");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "user");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());

        // when
        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/64");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
View Full Code Here

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());

        // when
        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();

        // then
View Full Code Here

    @Test
    public void applicationJson_profileIncorrect_returns406() throws Exception {

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/55/properties/anInt");
        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());

        // when
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
View Full Code Here

    public void runtimeException_isMapped() throws Exception {

        // given
        final RestfulRequest restfulReq = client.createRequest(RestfulHttpMethod.GET, "version");
        final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean());
        restfulReq.withHeader(header, true);

        // when
        final RestfulResponse<JsonRepresentation> jsonResp = restfulReq.execute();

        // then
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.