Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonar fixes #285

Merged
merged 10 commits into from
Apr 24, 2024
Prev Previous commit
Next Next commit
test: page size greater than int val
Toto-hitori committed Apr 24, 2024
commit 411999164e691f02dfd1727a95cf469fc85d031b
Original file line number Diff line number Diff line change
@@ -190,7 +190,6 @@ void getQuestionsWithPageInvalidPage() {
@Test
void getQuestionsWithPageGreaterThanSize() {
when(questionRepository.findAll()).thenReturn(List.of(defaultQuestion));

assertThrows(IllegalArgumentException.class,() -> questionService.getQuestionsWithPage(2L));
}

@@ -200,4 +199,11 @@ void getQuestionsWithPageNoQuestions() {
Assertions.assertEquals(questionService.getQuestionsWithPage(1L), List.of());
}

@Test
void getQuestionsWithPageTooBig() {
when(questionRepository.findAll()).thenReturn(List.of(defaultQuestion));
Assertions.assertThrows(IllegalArgumentException.class, () -> questionService.getQuestionsWithPage(100000000L));

}

}