/** * Gets the rating applied date for the specified node in the specified scheme by * the currently authenticated user. * @param node ScriptNode * @param ratingSchemeName String * @return rating applied date if there is one, else <code>null</code> */ public Date getRatingAppliedAt(ScriptNode node, String ratingSchemeName) { final Rating ratingByCurrentUser = ratingService.getRatingByCurrentUser(node.getNodeRef(), ratingSchemeName); return ratingByCurrentUser == null ? null : ratingByCurrentUser.getAppliedAt(); }
/** * Gets the rating applied date for the specified node in the specified scheme by * the currently authenticated user. * @param node ScriptNode * @param ratingSchemeName String * @return rating applied date if there is one, else <code>null</code> */ public Date getRatingAppliedAt(ScriptNode node, String ratingSchemeName) { final Rating ratingByCurrentUser = ratingService.getRatingByCurrentUser(node.getNodeRef(), ratingSchemeName); return ratingByCurrentUser == null ? null : ratingByCurrentUser.getAppliedAt(); }
assertEquals("Wrong score for rating", fiveStarScore, (int)fiveStarRating.getScore()); assertEquals("Wrong user for rating", AuthenticationUtil.getFullyAuthenticatedUser(), fiveStarRating.getAppliedBy()); final Date fiveStarRatingAppliedAt = fiveStarRating.getAppliedAt(); assertEquals("Wrong score for rating", updatedFiveStarScore, (int)updatedFiveStarRating.getScore()); assertEquals("Wrong user for rating", AuthenticationUtil.getFullyAuthenticatedUser(), updatedFiveStarRating.getAppliedBy()); assertTrue("five star rating date was unchanged.", fiveStarRatingAppliedAt.equals(updatedFiveStarRating.getAppliedAt()) == false); assertEquals("Wrong score for rating", updatedFiveStarScore, (int)deletedStarRating.getScore()); assertEquals("Wrong user for rating", AuthenticationUtil.getFullyAuthenticatedUser(), deletedStarRating.getAppliedBy()); assertEquals("Wrong date for rating", updatedFiveStarRating.getAppliedAt(), deletedStarRating.getAppliedAt());