예제 #1
0
 @Test
 public void getURIToSourceEntry_Forum() {
   when(publisher.getSourceType()).thenReturn(ForumNotificationTypeHandler.FORUM_SOURCE_TYPE);
   when(publisher.getSubcontextId()).thenReturn(subContextId);
   String uriToSourceEntry = uriBuilderTestObject.getURIToSourceEntry(publisher, sourceEntryId);
   assertEquals(
       "Wrong URI with type " + publisher.getSourceType(),
       testContextPathUri
           + "/url/RepositoryEntry/"
           + contextId
           + "/CourseNode/"
           + subContextId
           + "/Message/"
           + sourceEntryId,
       uriToSourceEntry);
 }
예제 #2
0
 private void checkUriToContext() {
   when(publisher.getSubcontextId()).thenReturn(subContextId);
   String uriToEventSource = uriBuilderTestObject.getURIToEventSource(publisher);
   assertEquals(
       "Wrong URI with type " + publisher.getSourceType(),
       testContextPathUri + "/url/RepositoryEntry/" + contextId + "/CourseNode/" + subContextId,
       uriToEventSource);
 }
예제 #3
0
 @Test
 public void getURIToEventSource_Wiki() {
   when(publisher.getSourceType()).thenReturn(WikiNotificationTypeHandler.WIKI_SOURCE_TYPE);
   checkUriToContext();
 }
예제 #4
0
 @Test
 public void getURIToEventSource_Forum() {
   when(publisher.getSourceType()).thenReturn(ForumNotificationTypeHandler.FORUM_SOURCE_TYPE);
   checkUriToContext();
 }