Package com.taskadapter.redmineapi.bean

Examples of com.taskadapter.redmineapi.bean.WikiPageDetail


    }

    @Ignore("requires manual configuration, see the source code.")
    @Test
    public void getSpecificWikiPageByProject() throws Exception {
        WikiPageDetail specificPage = manager.getWikiPageDetailByProjectAndTitle("projkey1410979585758", "Another");

        assertThat(specificPage.getTitle()).isEqualTo("Another");

        assertThat(specificPage.getText()).isEqualTo("this is a page too");
        assertThat(specificPage.getParent().getTitle()).isEqualTo("Wiki");
        assertThat(specificPage.getUser().getId()).isEqualTo(1);
        assertThat(specificPage.getVersion()).isEqualTo(2);
        assertThat(specificPage.getCreatedOn()).isNotNull();
        assertThat(specificPage.getUpdatedOn()).isNotNull();
        assertThat(specificPage.getAttachments()).isNotNull();
        assertThat(specificPage.getAttachments().size()).isEqualTo(1);

        Attachment attachment = specificPage.getAttachments().get(0);

        assertThat(attachment.getFileName()).isEqualTo("happy_penguin.jpg");
        assertThat(attachment.getId()).isEqualTo(8);
        assertThat(attachment.getFileSize()).isEqualTo(72158);
        assertThat(attachment.getAuthor().getFullName()).isEqualTo("Redmine Admin");
View Full Code Here


        wikiPage.setUpdatedOn(getDateOrNull(object, "updated_on"));
        return wikiPage;
    }

    public static WikiPageDetail parseWikiPageDetail(JSONObject object) throws JSONException {
        WikiPageDetail wikiPage = new WikiPageDetail();

        wikiPage.setTitle(JsonInput.getStringOrEmpty(object, "title"));
        wikiPage.setText(JsonInput.getStringOrEmpty(object, "text"));
        wikiPage.setParent(JsonInput.getObjectOrNull(object, "parent", WIKI_PAGE_DETAIL_PARSER));
        wikiPage.setUser(JsonInput.getObjectOrNull(object, "author", USER_PARSER));
        wikiPage.setVersion(JsonInput.getIntOrNull(object, "version"));
        wikiPage.setCreatedOn(getDateOrNull(object, "created_on"));
        wikiPage.setUpdatedOn(getDateOrNull(object, "updated_on"));
        wikiPage.setAttachments(JsonInput.getListOrNull(object, "attachments", ATTACHMENT_PARSER));

        return wikiPage;
    }
View Full Code Here

TOP

Related Classes of com.taskadapter.redmineapi.bean.WikiPageDetail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.