UriBuilder { public String getURIToContext(Publisher publisher) { return getURI(getBusinessPathToContext(publisher)); } UriBuilder(); String getURIToContext(Publisher publisher); String getURIToCourse(Long courseRepositoryEntryId); String getURIToGroup(Long groupId); String getURIToCourseNode(Long courseRepositoryEntryId, Long courseNodeId); String getURIToEventSource(Publisher publisher); String getURIToSourceEntry(Publisher publisher, String sourceEntryId); void setServerContextPathURI(String serverContextPathURI); String getNotificationTabContext(); String getUriToNotificationSettings(); String getUriToNotificationNews(); String getUriToAssessmentDetail(Long courseRepositoryEntryId, Long identityId, Long courseNodeId); String getUriToAssessmentView(Long courseRepositoryEntryId, Long identityId); String getAssessmentDetailContext(); String getTopicAssignmentTabContext(); String getUriToTopicAssignmentFolderTab(Long courseRepositoryEntryId, Long courseNodeId, Long topicId); String getUriToTopicAssignmentDescriptionTab(Long courseRepositoryEntryId, Long courseNodeId, Long topicId); String getUriToTopicAssignmentTab(Long courseRepositoryEntryId, Long courseNodeId, Long projectId, String tabId); String getURIToProject(Long courseRepositoryEntryId, Long courseNodeId, Long projectId);  }
@Test public void getURIToContext_ContextType_COURSE() { String uriToContext = uriBuilderTestObject.getURIToContext(publisher); assertEquals("Wrong URI to context", testContextPathUri + "/url/RepositoryEntry/" + contextId, uriToContext); }
@Test public void getURIToContext_ContextType_UNKOWN() { Publisher publisherUnkown = mock(Publisher.class); when(publisherUnkown.getContextType()).thenReturn(ContextType.UNKNOWN); String uriToContext = uriBuilderTestObject.getURIToContext(publisherUnkown); assertEquals("Wrong URI with unkown type", testContextPathUri + "/url/UNKOWN/0", uriToContext); }