Search in sources :

Example 6 with ForumVOes

use of org.olat.modules.fo.restapi.ForumVOes in project openolat by klemens.

the class CoursesForumsTest method testGetForumsInfo.

@Test
public void testGetForumsInfo() throws IOException, URISyntaxException {
    boolean loggedIN = conn.login("administrator", "openolat");
    assertTrue(loggedIN);
    URI uri = UriBuilder.fromUri(getNodesURI()).build();
    HttpGet get = conn.createGet(uri, MediaType.APPLICATION_JSON, true);
    HttpResponse response = conn.execute(get);
    assertEquals(200, response.getStatusLine().getStatusCode());
    ForumVOes forums = conn.parse(response, ForumVOes.class);
    assertNotNull(forums);
    assertEquals(1, forums.getTotalCount());
    assertNotNull(forums.getForums());
    assertEquals(1, forums.getForums().length);
}
Also used : ForumVOes(org.olat.modules.fo.restapi.ForumVOes) HttpGet(org.apache.http.client.methods.HttpGet) HttpResponse(org.apache.http.HttpResponse) URI(java.net.URI) Test(org.junit.Test)

Aggregations

URI (java.net.URI)6 HttpResponse (org.apache.http.HttpResponse)6 HttpGet (org.apache.http.client.methods.HttpGet)6 Test (org.junit.Test)6 ForumVOes (org.olat.modules.fo.restapi.ForumVOes)6 File (java.io.File)2 InputStream (java.io.InputStream)2 URL (java.net.URL)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2 PublisherData (org.olat.core.commons.services.notifications.PublisherData)2 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)2 Identity (org.olat.core.id.Identity)2 IdentityEnvironment (org.olat.core.id.IdentityEnvironment)2 Roles (org.olat.core.id.Roles)2 INode (org.olat.core.util.nodes.INode)2 Visitor (org.olat.core.util.tree.Visitor)2 ICourse (org.olat.course.ICourse)2 FOCourseNode (org.olat.course.nodes.FOCourseNode)2 CourseTreeVisitor (org.olat.course.run.userview.CourseTreeVisitor)2 VisibleTreeFilter (org.olat.course.run.userview.VisibleTreeFilter)2