final ObjectPropertyRepresentation propertyRepr = idPropertyJsonResp.getEntity();
assertThat(propertyRepr.getString("memberType"), is("property"));
// self link
final LinkRepresentation selfLink = propertyRepr.getLinkWithRel(Rel.SELF);
assertThat(selfLink, isLink(client)
.httpMethod(RestfulHttpMethod.GET)
.href(endsWith("/objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/68/properties/anInt"))
.returning(HttpStatusCode.OK)
.build());
// up link
final LinkRepresentation upLink = propertyRepr.getLinkWithRel(Rel.UP);
assertThat(upLink, isLink(client)
.httpMethod(RestfulHttpMethod.GET)
.href(endsWith("/objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/68"))
.returning(HttpStatusCode.OK)
.type(RepresentationType.DOMAIN_OBJECT.getMediaType())
.title("default-name")
.build());
//modify link
final LinkRepresentation modifyLink = propertyRepr.getLinkWithRel(Rel.MODIFY);
assertThat(modifyLink, isLink(client)
.httpMethod(RestfulHttpMethod.PUT)
.type(RepresentationType.OBJECT_PROPERTY.getMediaType())
.href(endsWith("/objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/68/properties/anInt"))
.build());
assertThat(modifyLink.getArguments(), is(not(nullValue())));
assertThat(modifyLink.getArguments().isArray(), is(false));
assertThat(modifyLink.getArguments().size(), is(1));
//clear link
final LinkRepresentation clearLink = propertyRepr.getLinkWithRel(Rel.CLEAR);
assertThat(clearLink, isLink(client)
.httpMethod(RestfulHttpMethod.DELETE)
.type(RepresentationType.OBJECT_PROPERTY.getMediaType())
.href(endsWith("/objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/68/properties/anInt"))
.build());
// described by link
final LinkRepresentation describedByLink = propertyRepr.getLinkWithRel(Rel.DESCRIBEDBY);
assertThat(describedByLink, isLink(client)
.returning(HttpStatusCode.OK)
.responseEntityWithSelfHref(describedByLink.getHref())
.build());
assertThat(propertyRepr.getInt("value"), is(42));
assertThat(propertyRepr.getString("format"),is("int"));
assertThat(propertyRepr.getString("extensions.x-isis-format"), is("int"));