use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class QuestionPoolServiceImplTest method shouldSetNewStatusOnlyIfChanged.
@Test
public void shouldSetNewStatusOnlyIfChanged() {
QuestionStatus status = QuestionStatus.draft;
item.setQuestionStatus(status);
Float rating = new Float(RATING_FIVE);
ReviewDecision decision = new ReviewDecision(false, QuestionStatus.finalVersion);
when(reviewServiceMock.decideStatus(item, rating)).thenReturn(decision);
sut.rateItemInReview(item, identityDummy, rating, null);
assertThat(item.getQuestionStatus()).isEqualTo(status);
}
use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class QuestionPoolServiceImplTest method shouldSaveRating.
@Test
public void shouldSaveRating() {
when(reviewServiceMock.decideStatus(any(), any())).thenReturn(new ReviewDecision(false, null));
sut.rateItemInReview(item, identityDummy, new Float(RATING_FIVE), null);
verify(commentAndRatingServiceMock).createRating(identityDummy, item, null, RATING_FIVE);
}
use of org.olat.modules.qpool.model.ReviewDecision in project OpenOLAT by OpenOLAT.
the class QuestionPoolServiceImplTest method shouldSetNewStatusIfChanged.
@Test
public void shouldSetNewStatusIfChanged() {
Float rating = new Float(RATING_FIVE);
QuestionStatus status = QuestionStatus.finalVersion;
ReviewDecision decision = new ReviewDecision(true, status);
when(reviewServiceMock.decideStatus(item, rating)).thenReturn(decision);
sut.rateItemInReview(item, identityDummy, rating, null);
assertThat(item.getQuestionStatus()).isEqualTo(status);
}
use of org.olat.modules.qpool.model.ReviewDecision in project openolat by klemens.
the class QuestionPoolServiceImplTest method shouldSaveRating.
@Test
public void shouldSaveRating() {
when(reviewServiceMock.decideStatus(any(), any())).thenReturn(new ReviewDecision(false, null));
sut.rateItemInReview(item, identityDummy, new Float(RATING_FIVE), null);
verify(commentAndRatingServiceMock).createRating(identityDummy, item, null, RATING_FIVE);
}
use of org.olat.modules.qpool.model.ReviewDecision in project openolat by klemens.
the class QuestionPoolServiceImplTest method shouldSetNewStatusOnlyIfChanged.
@Test
public void shouldSetNewStatusOnlyIfChanged() {
QuestionStatus status = QuestionStatus.draft;
item.setQuestionStatus(status);
Float rating = new Float(RATING_FIVE);
ReviewDecision decision = new ReviewDecision(false, QuestionStatus.finalVersion);
when(reviewServiceMock.decideStatus(item, rating)).thenReturn(decision);
sut.rateItemInReview(item, identityDummy, rating, null);
assertThat(item.getQuestionStatus()).isEqualTo(status);
}
Aggregations