@Test
public void testResolveDocumentReferenceWhenTypeIsSpace()
{

    EntityReference reference = resolver.resolve(new EntityReference("space", EntityType.SPACE),
        EntityType.DOCUMENT);
    Assert.assertEquals(EntityType.DOCUMENT, reference.getType());
    Assert.assertEquals("defpage", reference.getName());
    Assert.assertEquals(EntityType.SPACE, reference.getParent().getType());
    Assert.assertEquals("space", reference.getParent().getName());
    Assert.assertEquals(EntityType.WIKI, reference.getParent().getParent().getType());
    Assert.assertEquals("defwiki", reference.getParent().getParent().getName());
}