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

Examples of org.apache.isis.viewer.restfulobjects.applib.homepage.HomePageRepresentation


    public void followLink() throws Exception {

        // given
        final Response serviceResp = homePageResource.homePage();
        final RestfulResponse<HomePageRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final HomePageRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation putLink = selfLink.withMethod(RestfulHttpMethod.PUT);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(putLink);
View Full Code Here


    public void followLink() throws Exception {

        // given
        final Response serviceResp = homePageResource.homePage();
        final RestfulResponse<HomePageRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final HomePageRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation postLink = selfLink.withMethod(RestfulHttpMethod.POST);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(postLink);
View Full Code Here

        assertThat(restfulResponse.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));

        final HomePageRepresentation repr = restfulResponse.getEntity();
        assertThat(repr, is(not(nullValue())));
        assertThat(repr, isMap());

        assertThat(repr.getSelf(), isLink(client)
                                        .rel(Rel.SELF)
                                        .href(endsWith(":39393/"))
                                        .httpMethod(RestfulHttpMethod.GET)
                                        .type(RepresentationType.HOME_PAGE.getMediaType())
                                        .returning(HttpStatusCode.OK)
                                        );
        assertThat(repr.getUser(), isLink(client)
                                        .rel(Rel.USER)
                                        .href(endsWith(":39393/user"))
                                        .httpMethod(RestfulHttpMethod.GET)
                                        .type(RepresentationType.USER.getMediaType())
                                        .returning(HttpStatusCode.OK)
                                        );
        assertThat(repr.getServices(), isLink(client)
                                        .rel(Rel.SERVICES)
                                        .href(endsWith(":39393/services"))
                                        .httpMethod(RestfulHttpMethod.GET)
                                        .type(RepresentationType.LIST.getMediaType())
                                        .returning(HttpStatusCode.OK)
                                        );
        assertThat(repr.getVersion(), isLink(client)
                                        .rel(Rel.VERSION)
                                        .href(endsWith(":39393/version"))
                                        .httpMethod(RestfulHttpMethod.GET)
                                        .type(RepresentationType.VERSION.getMediaType())
                                        .returning(HttpStatusCode.OK)
                                        );

        assertThat(repr.getLinks(), isArray());
        assertThat(repr.getExtensions(), isMap());
    }
View Full Code Here

    public void followLink() throws Exception {

        // given
        final Response serviceResp = homePageResource.homePage();
        final RestfulResponse<HomePageRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final HomePageRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.restfulobjects.applib.homepage.HomePageRepresentation

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.