コード例 #1
0
 @Test
 public void updateAnExistingComment() {
   theComment.newText("a new text");
   CommentEntity entity = putAt(aResourceURI(), theComment);
   assertThat(entity, equalTo(theComment));
   assertThat(entity.getText(), equalTo(theComment.getText()));
 }
コード例 #2
0
 @Override
 public CommentEntity anInvalidResource() {
   Comment comment =
       theUser(user)
           .commentTheResource(CONTENT_ID)
           .inComponent(COMPONENT_INSTANCE_ID)
           .withAsText("ceci est un commentaire");
   comment.setCommentPK(new CommentPK("3", COMPONENT_INSTANCE_ID));
   return CommentEntity.fromComment(comment);
 }
コード例 #3
0
 @Before
 public void prepareTestResources() {
   user = save(aUser());
   sessionKey = authenticate(user);
   Comment commentToUseInTest =
       theUser(user)
           .commentTheResource(CONTENT_ID)
           .inComponent(COMPONENT_INSTANCE_ID)
           .withAsText("ceci est un commentaire");
   getTestResources().save(commentToUseInTest);
   theComment = CommentEntity.fromComment(commentToUseInTest);
 }
コード例 #4
0
 @Override
 public String anUnexistingResourceURI() {
   return INVALID_RESOURCE_PATH + "/" + theComment.getId();
 }
コード例 #5
0
 @Override
 public String aResourceURI() {
   return RESOURCE_PATH + "/" + theComment.getId();
 }