Examples of HomePageRepresentation


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

        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).httpMethod(HttpMethod.GET));
        assertThat(repr.getUser(), isLink(client).httpMethod(HttpMethod.GET));
        assertThat(repr.getServices(), isLink(client).httpMethod(HttpMethod.GET));
        assertThat(repr.getVersion(), isLink(client).httpMethod(HttpMethod.GET));

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

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

    }

    @Test
    public void self_isFollowable() throws Exception {
        // given
        final HomePageRepresentation repr = givenRepresentation();

        // when, then
        assertThat(repr, isFollowableLinkToSelf(client));
    }
View Full Code Here

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

    }

    @Test
    public void links() throws Exception {
        // given
        final HomePageRepresentation repr = givenRepresentation();

        // when, then
        assertThat(repr.getServices(), isLink(client).returning(HttpStatusCode.OK));
        assertThat(repr.getUser(), isLink(client).returning(HttpStatusCode.OK));
        assertThat(repr.getVersion(), isLink(client).returning(HttpStatusCode.OK));
    }
View Full Code Here

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

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 postLink = selfLink.withMethod(RestfulHttpMethod.POST);

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

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

        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

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 deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
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.