Examples of executeT()


Examples of org.apache.isis.viewer.json.applib.RestfulRequest.executeT()

    public void applicationJson_profileList() throws Exception {

        final String href = givenLinkToService();

        final RestfulRequest request = client.createRequest(HttpMethod.GET, href).withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.DOMAIN_OBJECT.getMediaType());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
    }

    @Test
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RestfulRequest.executeT()

    public void applicationJson_invalid() throws Exception {

        final String href = givenLinkToService();

        final RestfulRequest request = client.createRequest(HttpMethod.GET, href).withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.NOT_ACCEPTABLE));
    }

    private String givenLinkToService() throws JsonParseException, JsonMappingException, IOException {
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RestfulRequest.executeT()

        clientRequestConfigurer.setHttpMethod(getHttpMethod());

        clientRequestConfigurer.configureArgs(requestArgs);

        final RestfulRequest restfulRequest = new RestfulRequest(clientRequestConfigurer);
        return restfulRequest.executeT();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
View Full Code Here

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

    public static JsonRepresentation givenAction(RestfulClient client, final String serviceId, final String actionId) throws JsonParseException, JsonMappingException, IOException {
        final String href = givenHrefToService(client, serviceId);
        final String detailRel = Rel.DETAILS.andParam("action", actionId);

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members[%s].links[rel=%s]", actionId, detailRel);
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();

        final JsonRepresentation actionLinkRepr = repr.getAction(actionId);
View Full Code Here

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

        // 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
        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
    }
View Full Code Here

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

        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/" +
                oid +
                "/collections/visibleAndEditableCollection");

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

        assertThat(restfulResponse.getStatus(), is(statusCode1));
    }

}
View Full Code Here

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

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/64/collections/invisibleCollection");

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

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_FOUND));
    }

}
View Full Code Here

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

        // given
        RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/64/collections/nonExistentCollection");

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

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_FOUND));
    }

}
View Full Code Here

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

        // 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
        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
    }
View Full Code Here

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

    @Test
    public void domainObjectRepresentationForTransient_hasNoSelf_andHasNoOid() throws Exception {

        // given, when
        final RestfulRequest request = this.client.createRequest(RestfulHttpMethod.POST, "services/simples/actions/newTransientEntity/invoke");
        final RestfulResponse<ActionResultRepresentation> response = request.executeT();
        final ActionResultRepresentation actionResultRepr = response.getEntity();
        assertThat(actionResultRepr.getResultType(), is(ResultType.DOMAIN_OBJECT));
        assertThat(actionResultRepr.getResult(), is(not(nullValue())));

        final DomainObjectRepresentation domainObjectRepr = actionResultRepr.getResult().as(DomainObjectRepresentation.class);
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.