com.silverpeas.comment.service
Class CommentBuilder

java.lang.Object
  extended by com.silverpeas.comment.service.CommentBuilder

public class CommentBuilder
extends Object

A comment builder dedicated to unit tests.


Method Summary
 Comment buildOrphelanWith(String author, String text)
          Builds a comment with the specified author and with the specified comment text.
 Comment buildWith(String author, String text)
          Builds a comment with the specified author and with the specified comment text.
static CommentBuilder getBuilder()
           
static CommentPK getResourcePrimaryPK()
          Gets the unique identifier of the resource to which comments are built by all of the CommentBuilder instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBuilder

public static CommentBuilder getBuilder()

buildWith

public Comment buildWith(String author,
                         String text)
Builds a comment with the specified author and with the specified comment text. All built comments are about the same resource.

Parameters:
author - the author of the comment.
text - the text of the comment.
Returns:
a Comment instance.

buildOrphelanWith

public Comment buildOrphelanWith(String author,
                                 String text)
Builds a comment with the specified author and with the specified comment text. The publication on which the comment is is not set; the comment is orphelan.

Parameters:
author - the author of the comment.
text - the text of the comment.
Returns:
a Comment instance.

getResourcePrimaryPK

public static CommentPK getResourcePrimaryPK()
Gets the unique identifier of the resource to which comments are built by all of the CommentBuilder instances.

Returns:
the primary key of the commented resource.


Copyright © 2016 Silverpeas. All Rights Reserved.