com.atlassian.confluence.it.api
Class ApiEntityConverter

java.lang.Object
  extended by com.atlassian.confluence.it.api.ApiEntityConverter

public class ApiEntityConverter
extends java.lang.Object

Converts API Model entities into test-support objects like Page and Blogpost.


Field Summary
static com.google.common.base.Function<Content,? extends AbstractContentEntity> convertApiContentToIt
           
 
Constructor Summary
ApiEntityConverter()
           
 
Method Summary
static java.util.List<Attachment> convertApiContentPageToItAttachments(PageResponse<Content> contents)
           
static Attachment convertApiContentToItAttachment(Content attachmentContent)
           
static BlogPost convertApiContentToItBlogPost(Content content)
           
static Comment convertApiContentToItComment(Content content)
           
static Page convertApiContentToItPage(Content content)
           
static Page convertApiContentToItPage(com.atlassian.fugue.Option<Content> contentOption)
           
static User convertApiPersonToItUser(Person person)
           
static Space convertApiSpaceToItSpace(Space space)
           
static java.util.List<AttachmentUpload> convertAttachmentsToUploads(Attachment... attachments)
          Convert IT Attachment objects into AttachmentUpload versions suitable for sending to the ContentService.
static AttachmentUpload convertAttachmentToUpload(Attachment attachment)
           
static Content convertItAttachmentToApiContent(Attachment attachment)
           
static Content convertItBlogPostToApiContent(BlogPost blogPost, ContentRepresentation format)
           
static Content convertItCommentToApiContent(Comment comment, ContentRepresentation format)
           
static Content convertItContentToApiContent(ContentEntity entity)
           
static Content convertItPageToApiContent(Page page)
          Converts an acceptance-test Page object into an API Content instance, where the body of the Content is in the ContentRepresentation.STORAGE format.
static Content convertItPageToApiContent(Page page, ContentRepresentation format)
          Converts an acceptance-test Page object into an API Content instance, where the body of the Content is in the passed ContentRepresentation format.
static Space convertItSpaceToApiSpace(Space space)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

convertApiContentToIt

public static com.google.common.base.Function<Content,? extends AbstractContentEntity> convertApiContentToIt
Constructor Detail

ApiEntityConverter

public ApiEntityConverter()
Method Detail

convertApiContentToItPage

public static Page convertApiContentToItPage(com.atlassian.fugue.Option<Content> contentOption)

convertApiContentToItPage

public static Page convertApiContentToItPage(Content content)

convertApiContentToItBlogPost

public static BlogPost convertApiContentToItBlogPost(Content content)

convertApiContentToItComment

public static Comment convertApiContentToItComment(Content content)

convertApiContentToItAttachment

public static Attachment convertApiContentToItAttachment(Content attachmentContent)

convertApiPersonToItUser

public static User convertApiPersonToItUser(Person person)

convertItPageToApiContent

public static Content convertItPageToApiContent(Page page)
Converts an acceptance-test Page object into an API Content instance, where the body of the Content is in the ContentRepresentation.STORAGE format.


convertItPageToApiContent

public static Content convertItPageToApiContent(Page page,
                                                ContentRepresentation format)
Converts an acceptance-test Page object into an API Content instance, where the body of the Content is in the passed ContentRepresentation format.


convertItBlogPostToApiContent

public static Content convertItBlogPostToApiContent(BlogPost blogPost,
                                                    ContentRepresentation format)

convertItContentToApiContent

public static Content convertItContentToApiContent(ContentEntity entity)

convertItCommentToApiContent

public static Content convertItCommentToApiContent(Comment comment,
                                                   ContentRepresentation format)

convertItSpaceToApiSpace

public static Space convertItSpaceToApiSpace(Space space)

convertApiSpaceToItSpace

public static Space convertApiSpaceToItSpace(Space space)

convertAttachmentsToUploads

public static java.util.List<AttachmentUpload> convertAttachmentsToUploads(Attachment... attachments)
                                                                    throws java.io.IOException
Convert IT Attachment objects into AttachmentUpload versions suitable for sending to the ContentService.

Throws:
java.io.IOException

convertAttachmentToUpload

public static AttachmentUpload convertAttachmentToUpload(Attachment attachment)
                                                  throws java.io.IOException
Throws:
java.io.IOException

convertApiContentPageToItAttachments

public static java.util.List<Attachment> convertApiContentPageToItAttachments(PageResponse<Content> contents)

convertItAttachmentToApiContent

public static Content convertItAttachmentToApiContent(Attachment attachment)


Copyright © 2003-2014 Atlassian. All Rights Reserved.