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