Пример #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);
  }
Пример #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"));
  }
Пример #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);
  }
Пример #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"));
  }
Пример #5
0
 @Test
 public void testGetBookmarksTags() {
   JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
   JsonJavaObject json = previewPage.getJson();
   Assert.assertNotNull(json.getString("tagTerm"));
 }