Skip to content

Commit

Permalink
Address last changes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cremertim committed Nov 26, 2024
1 parent 8739d9c commit 03c5ae9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ void testGetAllCoursesForDashboardRealisticQueryCount() throws Exception {
// 1 DB call to get the batch of a live quiz. No Batches of other quizzes are retrieved

var course = courses.getFirst();
// potentially, we might get a course that has faqs disabled, in which case we would have 12 calls instead of 13
int numberOfCounts = course.isFaqEnabled() ? 13 : 12;
assertThatDb(() -> {
log.info("Start course for dashboard call for one course");
var userCourse = request.get("/api/courses/" + course.getId() + "/for-dashboard", HttpStatus.OK, Course.class);
log.info("Finish courses for dashboard call for one course");
return userCourse;
}).hasBeenCalledTimes(13); // TODO: reduce this number back to 11
}).hasBeenCalledTimes(numberOfCounts);
// 1 DB call to get the user from the DB
// 1 DB call to get the course with lectures
// 1 DB call to load all exercises with categories
Expand All @@ -88,7 +90,7 @@ void testGetAllCoursesForDashboardRealisticQueryCount() throws Exception {
// 1 DB call to get all plagiarism cases
// 1 DB call to get the grading scale
// 1 DB call to get the batch of a live quiz. No Batches of other quizzes are retrieved
// 1 DB call to get the faqs
// 1 DB call to get the faqs, if they are enabled
}

@Test
Expand Down

0 comments on commit 03c5ae9

Please sign in to comment.