@Test void getDocumentViewURLWhenBaseReferenceSpecified() { ResourceReference reference = new ResourceReference("reference", ResourceType.DOCUMENT); reference.addBaseReference("base"); EntityReference documentReference = new DocumentReference("wiki", "space", "page"); when(this.referenceResolver.resolve(reference, EntityType.DOCUMENT)).thenReturn(documentReference); when(this.documentAccessBridge.getDocumentURL(documentReference, "view", null, null)).thenReturn("viewurl"); assertEquals("viewurl", this.wikiModel.getDocumentViewURL(reference)); }
@Override public String getDocumentViewURL(ResourceReference resourceReference) { EntityReference documentReference = getDocumentEntityReference(resourceReference); if (documentReference == null) { throw new IllegalArgumentException(String.valueOf(resourceReference)); } return this.documentAccessBridge.getDocumentURL(documentReference, "view", resourceReference.getParameter(DocumentResourceReference.QUERY_STRING), resourceReference.getParameter(DocumentResourceReference.ANCHOR)); }
XWikiWikiModel implements WikiModel { @Override public String getDocumentViewURL(ResourceReference resourceReference) { EntityReference documentReference = getDocumentEntityReference(resourceReference); if (documentReference == null) { throw new IllegalArgumentException(String.valueOf(resourceReference)); } return this.documentAccessBridge.getDocumentURL(documentReference, "view", resourceReference.getParameter(DocumentResourceReference.QUERY_STRING), resourceReference.getParameter(DocumentResourceReference.ANCHOR)); } }
XWikiWikiModel implements WikiModel { @Override public String getDocumentViewURL(ResourceReference resourceReference) { EntityReference documentReference = getDocumentEntityReference(resourceReference); if (documentReference == null) { throw new IllegalArgumentException(String.valueOf(resourceReference)); } return this.documentAccessBridge.getDocumentURL(documentReference, "view", resourceReference.getParameter(DocumentResourceReference.QUERY_STRING), resourceReference.getParameter(DocumentResourceReference.ANCHOR)); }  }
XWikiWikiModel implements WikiModel { @Override public String getDocumentViewURL(ResourceReference resourceReference) { EntityReference documentReference = getDocumentEntityReference(resourceReference); if (documentReference == null) { throw new IllegalArgumentException(String.valueOf(resourceReference)); } return this.documentAccessBridge.getDocumentURL(documentReference, "view", resourceReference.getParameter(DocumentResourceReference.QUERY_STRING), resourceReference.getParameter(DocumentResourceReference.ANCHOR)); }  @Override String getLinkURL(ResourceReference linkReference); @Override String getImageURL(ResourceReference imageReference, Map<String, String> parameters); @Override boolean isDocumentAvailable(ResourceReference resourceReference); @Override String getDocumentViewURL(ResourceReference resourceReference); @Override String getDocumentEditURL(ResourceReference resourceReference); @Override XDOM getXDOM(ResourceReference resourceReference); }
XWikiWikiModel implements WikiModel { @Override public String getDocumentViewURL(ResourceReference resourceReference) { EntityReference documentReference = getDocumentEntityReference(resourceReference); if (documentReference == null) { throw new IllegalArgumentException(String.valueOf(resourceReference)); } return this.documentAccessBridge.getDocumentURL(documentReference, "view", resourceReference.getParameter(DocumentResourceReference.QUERY_STRING), resourceReference.getParameter(DocumentResourceReference.ANCHOR)); }  @Override String getLinkURL(ResourceReference linkReference); @Override String getImageURL(ResourceReference imageReference, Map<String, String> parameters); @Override boolean isDocumentAvailable(ResourceReference resourceReference); @Override String getDocumentViewURL(ResourceReference resourceReference); @Override String getDocumentEditURL(ResourceReference resourceReference); @Override XDOM getXDOM(ResourceReference resourceReference);  }