Examples of VersionRepresentation


Examples of org.apache.isis.viewer.json.applib.version.VersionRepresentation

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

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

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

        assertThat(repr.getSelf(), isLink().httpMethod(HttpMethod.GET));

        assertThat(repr.getString("specVersion"), is("0.52"));
        assertThat(repr.getString("implVersion"), is(not(nullValue())));

        final JsonRepresentation optionalCapbilitiesRepr = repr.getOptionalCapabilities();
        assertThat(optionalCapbilitiesRepr, isMap());

        assertThat(optionalCapbilitiesRepr.getString("concurrencyChecking"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("transientObjects"), is("yes"));
        assertThat(optionalCapbilitiesRepr.getString("deleteObjects"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("simpleArguments"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("partialArguments"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("followLinks"), is("yes"));
        assertThat(optionalCapbilitiesRepr.getString("validateOnly"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("pagination"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("sorting"), is("no"));
        assertThat(optionalCapbilitiesRepr.getString("domainModel"), is("rich"));

        assertThat(repr.getLinks(), isArray());
        assertThat(repr.getExtensions(), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.version.VersionRepresentation

    }

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

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

Examples of org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation

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

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

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

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

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

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

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

        assertThat(repr.getSelf(), isLink(client)
                                    .rel(Rel.SELF)
                                    .href(endsWith(":39393/version"))
                                    .httpMethod(RestfulHttpMethod.GET)
                                    .type(RepresentationType.VERSION.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.getString("specVersion"), is("1.0.0"));
        assertThat(repr.getString("implVersion"), is(not(nullValue())));
        //assertThat(repr.getString("implVersion"), is(not("UNKNOWN")));

        final JsonRepresentation optionalCapbilitiesRepr = repr.getOptionalCapabilities();
        assertThat(optionalCapbilitiesRepr, isMap());

        assertThat(optionalCapbilitiesRepr.getString("blobsClobs"), is("yes"));
        assertThat(optionalCapbilitiesRepr.getString("deleteObjects"), is("yes"));
        assertThat(optionalCapbilitiesRepr.getString("domainModel"), is("formal"));
        assertThat(optionalCapbilitiesRepr.getString("validateOnly"), is("yes"));
        assertThat(optionalCapbilitiesRepr.getString("protoPersistentObjects"), is("yes"));

        assertThat(repr.getLinks(), isArray());
        assertThat(repr.getExtensions(), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation

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

        final RestfulResponse<VersionRepresentation> jsonResp = RestfulResponse.ofT(resp);
        final VersionRepresentation 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
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.