Search in sources :

Example 6 with BlockReference

use of org.xwiki.model.reference.BlockReference in project xwiki-platform by xwiki.

the class DefaultSignatureStoreTest method testRetrievingMissingSignature.

@Test
public void testRetrievingMissingSignature() throws Exception {
    XWikiDocument sourceDocument = mock(XWikiDocument.class);
    when(this.xwiki.getDocument(new DocumentReference("wiki", "space", "document"), this.xcontext)).thenReturn(sourceDocument);
    assertThat(this.store.retrieve(new BlockReference("block", new DocumentReference("wiki", "space", "document"))), nullValue());
    verify(sourceDocument).getXObject(new DocumentReference(DefaultSignatureStore.SIGNATURECLASS, new WikiReference("wiki")), DefaultSignatureStore.SIGNATURECLASS_PROP_REFERENCE, "block");
}
Also used : XWikiDocument(com.xpn.xwiki.doc.XWikiDocument) BlockReference(org.xwiki.model.reference.BlockReference) WikiReference(org.xwiki.model.reference.WikiReference) DocumentReference(org.xwiki.model.reference.DocumentReference) Test(org.junit.Test)

Aggregations

BlockReference (org.xwiki.model.reference.BlockReference)6 Test (org.junit.Test)5 DocumentReference (org.xwiki.model.reference.DocumentReference)5 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)4 BaseObject (com.xpn.xwiki.objects.BaseObject)3 WikiReference (org.xwiki.model.reference.WikiReference)3 IOException (java.io.IOException)1 Digest (org.xwiki.crypto.Digest)1 EntityReference (org.xwiki.model.reference.EntityReference)1