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

Examples of org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation


    public void followLink() throws Exception {

        // given
        final Response serviceResp = userResource.user();
        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final UserRepresentation 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 = userResource.user();
        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final UserRepresentation 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(jsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

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

        final UserRepresentation repr = jsonResp.getEntity();
        assertThat(repr, is(not(nullValue())));
        assertThat(repr.isMap(), is(true));

        assertThat(repr.getSelf(), isLink(client)
                                    .rel(Rel.SELF)
                                    .href(endsWith(":39393/user"))
                                    .httpMethod(RestfulHttpMethod.GET)
                                    .type(RepresentationType.USER.getMediaType())
                                    .returning(HttpStatusCode.OK)
                                    );
       
        assertThat(repr.getUp(), isLink(client)
                                    .rel(Rel.UP)
                                    .href(endsWith(":39393/"))
                                    .httpMethod(RestfulHttpMethod.GET)
                                    .type(RepresentationType.HOME_PAGE.getMediaType())
                                    .returning(HttpStatusCode.OK)
                                    );
        assertThat(repr.getUserName(), is(not(nullValue())));
       
        // TODO: change fixture so populated
        assertThat(repr.getFriendlyName(), is(nullValue()));
        assertThat(repr.getEmail(), is(nullValue()));
        assertThat(repr.getRoles(), is(not(nullValue())));

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

        // given
        final Response resp = resource.user();

        final RestfulResponse<UserRepresentation> jsonResp = RestfulResponse.ofT(resp);
        final UserRepresentation repr = jsonResp.getEntity();
        final LinkRepresentation selfLink = repr.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.user.UserRepresentation

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.