@Test
public void domainObjectRepresentationForPersistentObject_hasSelfAndOid() throws Exception {
// given, when
final DomainObjectRepresentation domainObjectRepr = givenDomainObjectRepresentationFor("OID:32");
// then
final LinkRepresentation self = domainObjectRepr.getSelf();
assertThat(self, isLink().rel(Rel.SELF).href(matches(".+objects/OID:32")).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects/domainobject"));
assertThat(domainObjectRepr.getLinkWithRel(Rel.DESCRIBEDBY), isLink().href(matches(".+" + ChildEntity.class.getName())).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects/domaintype"));
assertThat(domainObjectRepr.getTitle(), is("parent 4 - child 2"));
assertThat(domainObjectRepr.getOid(), is("OID:32"));
// no icon
final LinkRepresentation selfIcon = domainObjectRepr.getLinkWithRel(Rel.ICON);
assertThat(selfIcon, is(nullValue()));
}