Exemplo n.º 1
0
  @Test
  public void testCommunityNewSave() {
    JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
    JsonJavaObject json = previewPage.getJson();
    Assert.assertNull("Unexpected error detected on page", json.getString("code"));

    community = getCommunity(json.getString("getCommunityUuid"));
    assertCommunityValid(json);
  }
Exemplo n.º 2
0
  @Test
  public void testGetForumTopicInvalidArg() {
    addSnippetParam("ForumService.topicUuid", "");

    JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
    JsonJavaObject json = previewPage.getJson();
    Assert.assertEquals(400, json.getInt("code"));
    Assert.assertEquals("Invalid argument, expected topicUuid.", json.getString("message"));
  }
Exemplo n.º 3
0
  @Test
  public void testCreateForumTopic() {
    addSnippetParam("ForumService.forumUuid", forum.getForumUuid());

    JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
    JsonJavaObject json = previewPage.getJson();
    Assert.assertNull("Unexpected error detected on page", json.getString("code"));
    assertForumTopicProperties(json);
  }
Exemplo n.º 4
0
  @Test
  public void testGetForumTopicError() {
    addSnippetParam("ForumService.topicUuid", "Foo");

    JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
    JsonJavaObject json = previewPage.getJson();
    Assert.assertEquals(404, json.getInt("code"));
    Assert.assertEquals(
        "No existing forum found. Please contact your system administrator.",
        json.getString("message"));
  }
Exemplo n.º 5
0
 @Test
 public void testGetBookmarksTags() {
   JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
   JsonJavaObject json = previewPage.getJson();
   Assert.assertNotNull(json.getString("tagTerm"));
 }