@Test public void updateAnExistingComment() { theComment.newText("a new text"); CommentEntity entity = putAt(aResourceURI(), theComment); assertThat(entity, equalTo(theComment)); assertThat(entity.getText(), equalTo(theComment.getText())); }
@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); }
@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); }
@Override public String anUnexistingResourceURI() { return INVALID_RESOURCE_PATH + "/" + theComment.getId(); }
@Override public String aResourceURI() { return RESOURCE_PATH + "/" + theComment.getId(); }